Java is an interpreted language. It compiles to bytecode instead of machine language. The compiled application is portable between platforms without recompiling.
In computing, the Java Native Interface (JNI) is a programming framework that enables Java code running in a Java Virtual Machine (JVM) to call and be called by native applications (programs specific to a hardware and operating system platform) and libraries written in other languages such as C, C++ and assembly.
Java editions include Standard Edition(SE), Enterprise Edition(EE) and Micro Edition(ME).
All code is defined in classes. Classes are defined in source code files with .java extension. The javac command compiles Java code into bytecode. The java command runs compiled bytecode files.
Java is case sensitive.
Identifier Conventions:
Classes start with uppercase character.
Methods and variables start with lowercase character.
Constants are all uppercase.
Input "CMD" in windows explorer's address bar will open cmd window with the path of the folder entered.
Primitive data types include numbers, characters, and booleans. They are stored in fastest available memory and their names are all lowercase. Remember, String is not a primitive.
Java is a statically typed language and all variables must have their types declared.
Primitive numeric variables default to 0.
An object is an instance of a class. Nonprimitive variables are references to objects.
String values are instances of java.lang.String.
String objects are immutable. Resetting the value of a String creates a new object.
Instance method - method defined in a class which is only accessable through the Object of the class are called Instancemethod.
String literal in Java is immutable.
----------------------
IntelliJ idea
C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2019.1\bin目录下的idea.exe.vmoptions默认设置如下:
-server
-Xms128m
-Xmx512m
-XX:ReservedCodeCacheSize=240m
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-Djdk.http.auth.tunneling.disabledSchemes=""
-XX:+HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow
更为下面的设置:
-server
-Xms1024m
-Xmx8192m
-XX:ReservedCodeCacheSize=1024m
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-Djdk.http.auth.tunneling.disabledSchemes=""
-XX:+HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow
-----------------
Encapsulation helps to package complex functionality for ease of programming and to restrict accessing to individual functions and to hide complex functionality in methods.
Java supports single inheritance. Each class can extend only one direct superclass.
Inheritance relationship can be described as parent/child, base/derived, or superclass/subclass.
If a class isn't final, it can be extended.