1.classpath environment variable * When a Java virtual machine needs to run a class, the basic syntax for the required class file 2.java is found under the path defined in the CLASSPATH environment variable * Java language is strictly case-sensitive * Java program Consecutive strings in a sentence cannot be written in two lines, for example: System.out.println ("This is the first Java program!"); If you want to write a long string in two lines for readability, you can concatenate the two strings with a plus sign (+), for example: System.out.println ("This is the first" + "Java program!"); Naming rules in 3.java * Package name all letters are lowercase for example: Cn.java.test * class name and interface name capitalize the first letter of each word for example: ArrayList, Iterator * variable name, and method name lowercase, starting with a second word Start each word capitalize for example: Getlinenumber * Constant name All letters are capitalized, and words are underlined between them. For example: Day_of_month4.java variable data type * basic data type 1. numeric Type A. Integer type (byte,short,int,long) byte:8 bit (1 bytes) short:16 bit (2 bytes) int:32 bit (4 bytes) long:64 bit (8 bytes) b. Floating-point type (float,double) float:32 bit (4 bytes) double:64 bit (8 bytes) In Java, a decimal number is defaulted to a double type, so when assigning a value to a variable of type float, you must precede the value with the letter f (or lowercase letter f) 2. Character type (char) each char type variable consumes 2 byte 3. Boolean (Boolean) * reference data type 1. Class 2. Interface (interface) 3. Array 4. Enumeration (enum) 5. Annotations (annotation) 5. Overloading of Methods * The method name is the same in the same class, but the parameter type or the number of parameters in the method with the same name is different
Fundamentals of Java Programming