Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!

Shaliey Gowtham

Ranch Hand
+ Follow
since Mar 20, 2006
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Shaliey Gowtham

Shiva,You missed the closing curly braces inside the parameter call and have added it outside the paranthesis.
Could you get it?
Even a empty file is a valid java file and will compile.
I think this is not an language specification,
but only a compiler level requirement.
Can anyone help out more?
Possibly no way to do this, as any integer with leading zero is generally a octal number.
Can anyone help with any of the format options available?
14 years ago
Charles,
What about the overriding feature and super class and child class relationship in these methods and about run time polymorphism?
Is this going out of the exam much?!!
[ May 10, 2006: Message edited by: Shaliey Gowtham ]
SCJP 1.5 its bit tough when compared to 1.4
But if you have enough time then go for it.
Hi Mathias De Groof,
Welcome to JavaRanch.
Nice to point out the variables uninitialized.
But choice 1 is correct as there can be only one thread executing one synchronized block to the fullest on an instance(Object has only one lock);

i.e when one thread has entered a synchronized method in a class for a particular object no other thread can execute any other synchronized methods for that particular object in reference to non-static methods

Hope that's clear.
[ May 10, 2006: Message edited by: Shaliey Gowtham ]
Harshil, i failed to notice the warning, thanks.
Thanks Edisandro, but its just to get about a little deep.
How to solve this:


How to solve this inheritance problem?
Is it overriding?
Consider
Example 1:

Compiler complains that the overridden method doesn't have '...'
But when declared as
Example 2:

Still compiler complains that the method is already defined.

Is this the behavior expected?
[ May 10, 2006: Message edited by: Shaliey Gowtham ]
Only choices 1 & 2 are correct.

Choice 3 is incorrect because many threads can access the method c() as its not synchronized(i.e. two threads might have incremented the k.v but none has decremented k.v, thus k.v > 1);
Choice 4 is incorrect since when the method c() alone is called then k.v > j.v;
Choice 5 is incorrect because in method b(), j.inc() is called before k.inc() so in this condition j.v > k.v

[ May 10, 2006: Message edited by: Shaliey Gowtham ]
When the class is not visible, then none of its members are visible.
But we have the member methods to be public because mostly all the classes implement interfaces and we are forced to have the methods to be public.

Further in future when the class is made visible outside we need not change the API.
What if i need to have a method taking array as parameter,
and also need to invoke the varargs of the same type?