Joke Collection Website - Cold jokes - Problems of java language foundation

Problems of java language foundation

java is one of the popular high-level languages. It is characterized by supporting object-oriented, portability and good security. A java program first compiles the source code into machine language of bytecode through a compiler, and then explains its execution in a virtual machine. For the convenience of transplantation, java does not generate EXE (EXECUTABLE executable file under windows), so it can run in systems outside Windows. As for the game, it is the same as the ordinary program. Its characteristics are the characteristics of the general java program mentioned above.

You also asked about the concept of object-oriented. You have been exposed to such concepts as overloading, covering and interface, which are all from object-oriented. Object-oriented simply means supporting the operation of classes and objects. The concept of class and object is also introduced to simplify the code, so that programmers can better organize the code. This is the most basic concept of the two object-oriented.

Let me give you a description:

A class can be said to describe a concept. The class you write yourself (that is, the program segment after the class) contains the name of your concept, its attributes and the methods that can be realized.

an object is an instantiation of a class. For example, people are a class, so you and I are the objects of instantiation of "human". We describe a person, usually his name, gender, height and weight. . . Then you and I both have these attributes. We say that people can eat and walk, so this is the method in the category of "people". You and I also have these methods.

let's talk about inheritance: let's take this example. Man is an animal. Animals have attributes, such as sex and weight, and methods, such as birth and death. Then these attributes and methods are available to people, and they are also available to cats. Therefore, we can define "animal" as the parent class, and "human" and "cat" as two subclasses. Among them, "human" has special attributes and methods, such as "occupation" and "arithmetic calculation". And "cats" can "catch mice". So people and cats are all inherited from "animals", and they have all the attributes and methods of "animals", as well as other unique attributes and methods.