Home > Java > javaTutorial > Java language overview

Java language overview

巴扎黑
Release: 2017-06-23 15:47:38
Original
2078 people have browsed it

I personally believe that the basis for learning a programming language is to learn from demos.

Practice the console output tool. System.out.println outputs newlines, and System.out.print outputs no newlines.

package com;
public class Test {
public static void main(String[] args) {
System.out.println("hello, Tang Huimin.");
System.out.println(args[0]);
System.out.println(args[1]);
}
}

Configuration parameter args:

Run result:

package com;
public class Test {
public static void main(String[] args ) {
System.out.print("hello, Tang Huimin.");
System.out.print(args[0]);
System.out.print(args[1]);
}
}

Run result:

Output a triangle composed of "*"

package com;
public class Test {
public static void main(String[] args) {
System.out.println(" *");
System.out.println(" ***");
System.out.println("*****");
System.out.println("*****");
}
}

Run result:

Output symbol expression

package com;
public class Test {
public static void main(String[] args ) {
System.out.println(" ╭︿︿︿╮ ");
System.out.println(" {/ o o /}");
System.out.println(" ( (oo) )");
System.out.println(" ︶ ︶︶");
}
}

Result:

The above is the detailed content of Java language overview. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template