Fichas
Core Java
Fichas del conjunto (8)
- 1What is Final Variable ?Final is a keyword and used only for Variables.
Final variables cannot be modified.
Example:
public final String compantName="ABC pvt ltd"; - 2What is Final Class?When a class is defined as final then that class cannot be extended.
This is one way of avoiding the class from extending. - 3What is final Method?When a method is defined a final(parent class) then it cannot be overridden in the child class.
- 4Types of Variables?Local
Instance
Static - 5What is the Job of a compilerCompiles the code from .java to .class file
- 6What is the job of a JVM?Loads the .class file to memory.
Execute the main Method. - 7Primitive - Default Valuesbyte-0
short -0
int -0
long-0
float-0.0
double -0.0
char-" " (single space)
boolean =false - 8Default Values ? Instance variable static variable local variableInstance and static variable - Picks the Default value.
Local variable- We need to explicitly mention the value.