JAVA Ques
JAVA Ques
– Roll
No. –
Strea
m–
Q14. What's the base class in Java from which all classes
are derived? Ans:
Q26. Is there any way to skip Finally block of exception even if some
exception occurs in the exception block?
Ans:
Q27. When the constructor of a class is invoked?
Q32. In the below example, how many String Objects are created?
String s1="I am Java
Expert"; String s2="I am
C Expert"; String s3="I
am Java Expert";
Ans:
Q42. Can a class be a super class and a sub-class at the same time?
Give example. Ans:
Q43. How objects of a class are created if no constructor is
defined in the class? Ans:
Q52. How can we restrict inheritance for a class so that no class can
be inherited from it?
Ans:
}
}
Ans:
Q62. A person says that he compiled a java class successfully
without even having a main method in it? Is it possible?
Ans:
Ans:
Q64. What are the two environment variables that must be set in
order to run any Java programs?
Ans:
Q65. Can variables be used in Java without
initialization? Ans:
Q7G. Can we have any other return type than void for
main method? Ans:
Q80. I want to re-reach and use an object once it has been garbage
collected. How it's possible?
Ans:
Ans:
QG3. I want to persist data of objects for later use. What's the best
approach to do so? Ans: