Home > Back-end >  New people for help: any type, especially basic data types. The class attribute; How to understand?
New people for help: any type, especially basic data types. The class attribute; How to understand?

Time:02-26

1, recently based on zero learning Java, one theory is that any one type, especially basic data types. The class attribute, must: int. Class; Double. Class

2, intuitive feel int and double these have an int or double type, like a String; But I did not find Int, only Integer and Double wrapper class

My question:
-> But there is no class in the Integer and Double properties, that int. Class and Double class is where come of? How do you explain, if can have the sun number code can explain sense is better; Which help explain the great god, which is helping to tell me where I can illustrate the sun's code. A class; I am a all programming zero basis beginners Java need great god help

Thank you thank you

CodePudding user response:

.class files is. Compiled Java files generated bytecode file

CodePudding user response:

The
reference 1/f, Jason Williams (????????????? ?). Response:
is a class file. The compiled Java files generated bytecode file
thank you, that is the basic data types in the compiled class has an independent. Class files are you?

CodePudding user response:

Java virtual machine to automatically create nine predefined Class object representing the eight basic types and void,
These class and basic types have the same name Boolean, byte, char, short, int, long, float, double.
The eight basic types of Class object can be achieved by Java. Lang. Boolean. The TYPE of Java. Lang. Integer. To access such as TYPE, can also through the int. Class, Boolean. To access the Class, etc.
 Class a=int. Class; 
Class b=Integer. The Class;
Class c=Integer. TYPE;
System. The out. Println (a.h ashCode ());
System. The out. Println (b.h ashCode ());
System. The out. Println (c. ashCode ());

CodePudding user response:

CodePudding user response:

Suggest you don't sidetrack busy study new knowledge points can put the class involves the underlying personal interpretation (understand) : class is compiled a file type if single program it should be a kind of method (). Each class has a class method later when you come into contact with the reflection should can gradually understand
  • Related