Java programs are composed of many classes. classes contain a lot of data and methods for processing the data. Theoretically, classes can be designed by themselves. However, java programmers actually use the ready-made java class libraries, these class libraries are called java APIs.
Therefore, two things should be learned in the java World: 1. java language; 2. Using java class libraries.
Java is an object-oriented, distributed, cross-platform, multi-thread, network, and web programming language. It has three features in Object-Oriented Programming:
1. Data encapsulation: private, protected, and public for data confidentiality purposes.
2. Inheritance: the data or methods in the parent class (super class) are inherited to its sub-classes (subclass) for use. The sub-classes can also be inherited and used to achieve repeated use of data.
3. Polymorphism: methods with the same name have different program codes. That is, two show (), but the meaning is different, and the program is naturally different. One show () covers the other show () and becomes a "polymorphism ", it is also called the "same name ".
The first java program file:
Public class Hello {
Public static void main (String args [])
{
System. out. printIn ("hello word! ");
}
}