10 Tricky Core Java Interview Coding Questions :

(Answers are provided at the end).
1) Can you instantiate this class?
public class A
{
A a = new A();
}
2) Is the below code written correctly? If yes, what will be the output?
class A
{
static void staticMethod()
{
System.out.println("Static Method");
}
}
No comments:
Post a Comment