What are the data types supported by 1.Java? What is auto-unboxing?
The 8 basic data types supported in the Java language are:
- Byte
- Short
- Int
- Long
- Float
- Double
- Boolean
- Char
Auto-Boxing is a conversion of the Java compiler between the base data type and the corresponding object wrapper type. For example: Convert int into Integer,char into character, etc. The reverse is automatic unpacking.
What does the method overlay (overriding) and method overloading (overloading) in 2.Java mean?
Method overloads in Java occur when the same class has two or more methods with the same name but different parameters. In contrast, the method overrides the method that the subclass redefined the parent class. Method overrides must have the same method name, parameter list, and return type. The override may not restrict access to the methods it covers.
March 4 Brush Questions