Question-47: What is final variable?
Answer:
If you make any variable as final, you cannot change the value of final variable(It will be constant).
Question-48: What is final method?
Answer:
Final methods can’t be overridden..
Question-49: What is final class?
Answer:
Final class can’t be inherited.
Question-50: What is blank final variable?
Answer:
A final variable, not initalized at the time of declaration, is known as blank final variable.
Question-51: Can we intialize blank final variable?
Answer:
Yes, only in constructor if it is non-static. If it is static blank final variable, it can be initialized only in the static block.
Question-52: Can you declare the main method as final?
Answer:
Yes, such as, public static final void main(String[] args){}.
Answer:
If you make any variable as final, you cannot change the value of final variable(It will be constant).
Question-48: What is final method?
Answer:
Final methods can’t be overridden..
Question-49: What is final class?
Answer:
Final class can’t be inherited.
Question-50: What is blank final variable?
Answer:
A final variable, not initalized at the time of declaration, is known as blank final variable.
Question-51: Can we intialize blank final variable?
Answer:
Yes, only in constructor if it is non-static. If it is static blank final variable, it can be initialized only in the static block.
Question-52: Can you declare the main method as final?
Answer:
Yes, such as, public static final void main(String[] args){}.
No comments:
Post a Comment