Originally posted by Abdul Latif:
which are the correct forms of Overloading Constructors for the
class hai?
a. public void hai(int a)
b. hai(int a,int b)
c. public hai(int a)
d. int hai(int c, int d)
e. int hai()
f. int hai(String s)
according to me is b & c
but the ans is a & b.
_________________________________________________________________
What is the modifier that is used for a variable in the class to be accessed in subclass only?
A. public
B. none
C. protected
D. private
the ans is protected but protected does not have sub class access but also package access
i think the question is poorly worded.
_________________________________________________________________
class sreejith
2. {
3. public static void main(String args[])
4. {
5. String s="hello";
6. String s1="hello";
7. System.out.println(s1);
8. String s3=s1;
9. s1=null;
10. s=null;
11. }
Which line the garbage collector will invoke first?
a. 9
b. 10
c. never
The ans says c
but i say it is 10, correct me if iam wrong
_________________________________________________________________
Which of the following is used to find max of 2 numbers given?
a. max()
b. Math.max();
c. None of the above.
the ans says b , but there is no version of max() which takes no arguments so the ans is c.
Am i right
Q2:
none is right too though!
Which line the garbage collector will invoke first?
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |