Explain the scope or life time of class variables or static variables?


No Answer is Posted For this Question
Be the First to Post Answer

Post New Answer

More Core Java Interview Questions

What is ternary operator? Give an example.

0 Answers  


hi to all,i have a question on static block. i saved below as test.java class test extends a { static { System.out.println("test static"); } public static void main(String []dfs) { } } class a { static { System.out.println("a static"); } public static void main(String []asdf) { } } o/p as static test static but if i change base class as test class then class test { static { System.out.println("test static"); } public static void main(String []dfs) { } } class a extends test { static { System.out.println("a static"); } public static void main(String []asdf) { } } o/p test static explain me why "a static" wasn't print in second code when it is in derived class

1 Answers  


How will you calculate the depth of a binary tree if the tree contains 15 nodes?

0 Answers   Aricent,


Give a practical example of singleton class usage?

0 Answers  


What are different types of constants?

0 Answers  






What are the different access modifiers available in java?

0 Answers  


I/O blocking means?

1 Answers  


Name few java.lang classes introduced with java 8 ?

0 Answers  


What are packages and name a few?

4 Answers  


Can we add default constructor to Servlet?

1 Answers   Fidelity,


What is a variable declaration?

0 Answers  


What happens when a thread cannot acquire a lock on an object in java programming?

0 Answers  


Categories