Vidyavathi saravanan

Ranch Hand
+ Follow
since Sep 24, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Vidyavathi saravanan



Answer is 4.
My Question is why not 1 also.
Since methods are called based on Object , why option1 is not correct?

Anyone Please explain
I think again thbs is based on the 'Gauranteed Behavior' . So even if the Objects are made eligible for GC by nulling the reference, only if the GC is scheduled, the memory could be recovered for sure.??!!!

Answer is d:

My question is how come the increment statements in static main is able to access the non-static instance variable a. Wont' this generates a compiler-error?

(tag fixed and reformatted)

[ November 14, 2004: Message edited by: Barry Gaunt ]
[ November 14, 2004: Message edited by: Barry Gaunt ]

Answer is given as -5,6,-5,5.
My doubt is the 3 rd output.
Math.round(-5.49f)--- how come this is -5. As per my understanding it is -6.
Could anyone please explain this. Its confusing me a lot.


Thanks.


Answer is : arit
amit
false
true.
Wont the s2==s3 be true?.
[ November 11, 2004: Message edited by: Barry Gaunt ]
[CODE]
class Trebble{
int i = 99;
}
class Base extends Trebble{
int i =100;
}
public class Central extends Base{
public static void main(String argv[]){
Central c = new Central();
c.wynyard();
}
public void wynyard(){
Trebble t = new Central();
Base b = (Base) t;
System.out.println(b.i);
}

}
[/CODE}
1 Compile time error
2 Compilation and output of 99
3 Compilation and output of 100
4 Compilation, but runtime error because an instance of Trebble cannot be cast to type Base

The Correct Answer is 3).This is on what basis?
Folks,

Is there any way to use 'http://www.jchq.net/phezam/exam.php'( Marcs' Mock) exam to produce only new questions everytime when we freshly take the test. I mean to remember the loginid and to give only the not-so-far-tested(untested) questions.




---Thanks

Answer options:
Assume that garbage collection runs and all elligible objects are collected and finalized.
A It does not compile due to incorrect signature of the finalize method.
B It compiles but no text is written when it runs due to incorrect signature of the finalize method.
C Before "exiting" is written, 2 messages from finalize will be printed.
D Before "exiting" is written, 3 messages from finalize will be printed

Which one would be the answer?
(code tag fixed and missing }s added )
[ November 09, 2004: Message edited by: Barry Gaunt ]
This is one of the Mock Questions.

1. A constructor may not be declared as private
2 A Constructor with no arguments will be the default constructor
3 Constructors cannot be overloaded
4 A call to a constructor in a parent class can only be made from within a constructor


The correct answer : 4. Iam not able to understand what the 4th statement means. Anyone please explain this?

-Thanks
There is a question in one of Marc exam. Sorry I dont remember the exact wordings. But the essence is -
Is 'synchronized' keyword to be used only within classes that extend Thread?
All Test Takers,

Would u please suggest me as where to start with these Mock Tests? What are the different types available? Are u referring to the Ranch's compilation of mock tests or some other mock tests.

Appreciate ur reply.


--Vidya
20 years ago
Mark,

Please let me know if u have any of ur tests orgainsed objectivewise?


Thanks!!!
20 years ago
I have a doubt.

The String Objects are created in ' String pool'. (ma,ba,co,de).
Whether they are eligible for GC.? Or they are neglected by GC?
This is one of the questions from K&B.

Assume u have a class that holds two private variables: 'a' and 'b'. Which of the following pairs can prevent concurrent access problems in that class.?



Answers: B and F
My question is why not E ?


Answers: b,c
Could anyone explain how the answer is. I could guess b. But how come c?
Appreciate ur time and response!