1, Java is simple
Java is very similar to C + +, but much simpler. Of all the features of the Advanced programming language, what is not absolutely needed has been deleted. For example, Java has no operator overload, header files, preprocessing, pointer operations, structs, unions, multidimensional arrays, templates, and implicit type transformations. If you know a little C, C + + or Pascal, you will soon be navigating java. Here is a simple Java Hello World program:
The following is a reference fragment:
public class Hellointernet
{
public static void Main (String argv[])
{
System.out.println ("Hello internet!");
}
}
2, Java is Object-oriented
Java is an object-oriented programming language. In addition to simple types, such as numbers and Boolean operators, most of Java is objects.
Like any object-oriented language, Java code is organized by class. Each class defines a set of methods that specify the behavior of the object. A class can inherit the behavior of another class. At the root level of a class, it is usually a class object.
Java supports a single inheritance class hierarchy. This means that each class can inherit only one other class at a time. Some languages allow for multiple inheritance, but this can cause confusion and unnecessarily complicate the language. For example, it is hard to imagine that an object inherits the behavior of two completely different classes.
Java also supports the interface of the Digest class. This allows programmers to first define the methods of the interface without rushing to determine the implementation of the method immediately. A class can execute multiple interfaces, and thus has many of the benefits of true multiple inheritance. An object can also implement any number of interfaces. The Java interface is extremely similar to the IDL interface. It is easy to build a IDLJ compiler. This means that Java can be used in CORBA object systems to build distributed object systems. This compatibility is important in view of the use of IDL interfaces and CORBA object systems in many computer systems.
3, Java is a static type of
In a Java program, you must define the types of objects (numbers, characters, arrays, and so on) that you use. This helps programmers find problems quickly because they can detect type errors when the program compiles.
However, objects in the Java system also have dynamic types. It is often possible to require an object to be a dynamic type, so programmers write programs that can do different things for different types of objects.
4, Java is a compile-type
When you run a Java program, it is first compiled into byte code. Byte codes are very similar to machine instructions, so Java programs are very efficient. However, byte code is not specific to a particular machine, so Java programs can be executed on many different computers without recompiling.
The Java source program is compiled into a class file, which is equivalent to the byte code representation of the program. In a Java class file, all references to methods and instance variables are named by name and are resolved the first time the code is executed. This makes the code more generic, less susceptible to modification, and still efficient.
5, Java is the system structure of neutral
The Java language is the same for each type of computer. For example, simple types are invariant: integers are always 32 bits, and long integers are always 64 bits. Surprisingly, fashionable programming languages such as C and C + + are not. Because these languages are so freely defined, each compiler and development environment is different, which makes porting the program a nuisance. The porting of Java programs is easy and requires no recompilation.