Home  >  Article  >  Java  >  Java language overview

Java language overview

巴扎黑
巴扎黑Original
2017-06-23 15:47:382057browse

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!

Statement:
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