Vidyavathi saravanan

Ranch Hand
+ Follow
since Sep 24, 2004
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

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.


Answer is : arit
Wont the s2==s3 be true?.
[ November 11, 2004: Message edited by: Barry Gaunt ]
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();
public void wynyard(){
Trebble t = new Central();
Base b = (Base) t;

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?

Is there any way to use ''( 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.


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?

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.

19 years ago

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

19 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!