Can we access instance variables within static methods ?


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

Post New Answer

More Core Java Interview Questions

interface X{ void m1(); void m2(); } class Child2 extends Object implements X { public void m1(){ System.out.println("Child2 M1"); } public void m2(){ System.out.println("Child2 M2"); } } public class ParentChildInfterfaceDemo { public static void main(String[] args){ X x = new Child2(); X x1 = new Child2(); x.m1(); x.m2(); x.equals(x1); } } Will the above code work? If yes? Can you please explain why the code x.equals(x1) will work as the equals method is called on interface reference vaiable?

2 Answers  


I have a Arraylist object, it has duplecate values also. Now question is i want delete duplecate data in that objet with out using Set?

8 Answers   Aricent,


How is abstraction implemented in java ?

0 Answers  


What do u mean by wrapper Class? What do u mean by Jvm... How do u change JVM for other OS? Or No need to Change ...? its like tricky

6 Answers   Accenture, EDS,


Is boolean a data type in java?

0 Answers  


What is a wrapper method?

0 Answers  


what is the use of thread?Justify it by project point of view

7 Answers  


What are the 4 versions of java?

0 Answers  


Write a program in java to find the maximum and minimum value node from a circular linked list.

0 Answers  


What is a jit compiler?

0 Answers  


What does business logic mean?

0 Answers  


What are the fileinputstream and fileoutputstream?

0 Answers  


Categories