当前位置: 首页>编程语言>正文

Java - introduction of Java

Compare Java with C++

Java - introduction of Java,Java - introduction of Java_c++,第1张

Compare Java with Java Script

Java - introduction of Java,Java - introduction of Java_hive_02,第2张

Analyze a class (Main.java)

package com.example;
public class Main() {
public static void main(String[] args) {
System.out.println("Hello World");
}
}

Java - introduction of Java,Java - introduction of Java_hive_03,第3张

Java Command

  • java: runtime
  • javac: compiler
  • javadoc: docs builder
  • jar: archive builder

javac Main.java --> generate Main.class

java Main ---> run Main.class --> output: Hello World

Identifier Conventions

  • Class start with uppercase character: class MyClass
  • Methods and variables start with lowercase character:void doSomething(String withThis) {}
  • Constants are full uppercase:final String FIRSTNAME = "David";

Compare Java with C++

Java - introduction of Java,Java - introduction of Java_c++,第1张

Compare Java with Java Script

Java - introduction of Java,Java - introduction of Java_hive_02,第2张

Analyze a class (Main.java)

package com.example;
public class Main() {
public static void main(String[] args) {
System.out.println("Hello World");
}
}

Java - introduction of Java,Java - introduction of Java_hive_03,第3张

Java Command

  • java: runtime
  • javac: compiler
  • javadoc: docs builder
  • jar: archive builder

javac Main.java --> generate Main.class

java Main ---> run Main.class --> output: Hello World

Identifier Conventions

  • Class start with uppercase character: class MyClass
  • Methods and variables start with lowercase character:void doSomething(String withThis) {}
  • Constants are full uppercase:final String FIRSTNAME = "David";

Compare Java with C++

Java - introduction of Java,Java - introduction of Java_c++,第1张

Compare Java with Java Script

Java - introduction of Java,Java - introduction of Java_hive_02,第2张

Analyze a class (Main.java)

package com.example;
public class Main() {
public static void main(String[] args) {
System.out.println("Hello World");
}
}

Java - introduction of Java,Java - introduction of Java_hive_03,第3张

Java Command

  • java: runtime
  • javac: compiler
  • javadoc: docs builder
  • jar: archive builder

javac Main.java --> generate Main.class

java Main ---> run Main.class --> output: Hello World

Identifier Conventions

  • Class start with uppercase character: class MyClass
  • Methods and variables start with lowercase character:void doSomething(String withThis) {}
  • Constants are full uppercase:final String FIRSTNAME = "David";

https://www.xamrdz.com/lan/5sb1924421.html

相关文章: