Java basic syntax
Translation results:
Java is divided into three systems:
JavaSE (J2SE) (Java2 Platform Standard Edition, java platform standard edition)
JavaEE (J2EE) (Java 2 Platform, Enterprise Edition) , java platform Enterprise Edition)
JavaME (J2ME) (Java 2 Platform Micro Edition, java platform micro edition).
Java basic syntaxsyntax
A Java program can be thought of as a collection of objects that work together by calling each other's methods. The following briefly introduces the concepts of classes, objects, methods and instance variables.
Object: An object is an instance of a class and has state and behavior. For example, a dog is an object. Its status includes: color, name, and breed; its behaviors include: wagging its tail, barking, eating, etc.
Class: A class is a template that describes the behavior and status of a type of object.
Method: Method is behavior, and a class can have many methods. Logical operations, data modification, and all actions are completed in methods.
Instance variables: Each object has unique instance variables, and the state of the object is determined by the values of these instance variables.
Java basic syntaxexample
public class HelloWorld { /* The first Java program * It will print the string Hello World */ Public static void main(String []args) { System.out.println("Hello World"); // Print Hello World }}