Hai ra

Core Java interview Question and Answers, Core Java interview Questions

Core Java interview Question and Answers, Core Java interview Questions

Hi, Today i would to Share Some More Core Java interview Question and Answers.

corejava, java, advanced java interview questions

1. What is importance of static variable?
static variables are the  class level variables where all objects of  class refer to  same variable. If one object changes t value then the change gets reflected in all  objects.
2. Can we declare a static variable inside the  method?
Static varaibles are class level variables and they cannot t be declared inside the  method. If it is declared, then the  class will not compile.
3. What is Abstract Class and its  purpose?
A Class which doesn't provide complete implementation is called as an abstract class. Abstract classes enforce abstraction.
4. Can  abstract class be declared as final?
No. An abstract class without being inherited is of no use and hence will result in the  compile time error.
5. What is use of  abstract variable?
Variables cannot be declared as abstract. only the  classes and methods can be declared as abstract.
6. Can you create an object of the abstract class?
Not . Abstract classes cannot be instantiated.

Previous
Next Post »