Chris Johns

Greenhorn
+ Follow
since Jan 13, 2001
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 Chris Johns

Hi Guys,
Suppose a thread is running and it has acquired a lock on the object and now its time slice is over, then wht i wud want to know is whether the thread has to contend for the lock once again or the thread will start running with the lock(acquired previously) in the new time-slice.
Any help is appreciated.
Thanks..Chris.
How many objects are eligible for garbage collection when the control reaches line 4 if the method process() is called with the argument of 5?

1. public void process(int count)
{
2. for ( int i = 1; i < count; i++ )
{
3. Object temp = " Hello "+i;
}
4.
}
The ans for this is 0. But i feel it shld be 4 coz each time the loop is run the following strings will be created i.e Hello0,Hello1,Hello2,Hello3 which are distinct and will be eligible for garbage collection.
Can anyone clarify???
Thanks..Chris.

Thanks for ur help !!!
Hi,
K&M state that a Non static inner class can only have non static members. Then how come the following code compiles
public class A //This is a standard Top Level class.
{
class X
{
static final int j = 10; //compiles fine!
}
public static class B //This is also a Top Level class (but nested!)
{
}
}
Any help will be highly appreciated.
Thanks..Chris
Hi,
I have a problem for implementing RMI application. I have created a small application for which I have to copy Stub files to client machine.But with JWS, the stub files get dynamically loaded from the server. Can anyone help me to solve this problem in Weblogic.
Thanks,
Chris
19 years ago
Hi Steve,
Thanks for ur reply. Can u give me some more information on the above topic and also some other topics.
Also can u give me ur e-mail id so that we can correspond on a one-one basis.
Thanks indeed for ur help.
Thanks..Chris.
20 years ago
Hi,
I need a good research topic in the area of Distributed Objects programming in Java. This topic will help me in my Thesis for the M.S in Comp Science course.
Any help will be highly appreciated.
Thanks..Chris.
Hi,
I am an active visitor of javaranch. I needed some help from you all.I need a good research topic in the area of Distributed Object programming in Java. This topic will help me in my Thesis for the M.S in Comp Science course.
Any help will be highly appreciated.
Thanks..Chris.
20 years ago
Hi,
Could anyone of you suugest a good research topic on Ditributed object programming in Java. This is reqd for pursuing a thesis in my M.S in Comp Science Course.
Thanks..Chris
20 years ago
Hi,
The line
comments = comments.replace( '\'', ' ' ); is very important for the code to run as expected. If u just use
comments.replace( '\'', ' ' );. The code will run but the results will not be as expected.
Good Luck!!!
20 years ago
Hi,
I think all the explanations given are fine. One thing to add. In java we can't create an object on stack, whereas in C++ we can.
Good Luck !!!
20 years ago
Hi,
Just would like to add one more thing, the way the access modifiers go from being least restrictive to more restrictive is
public,protected,friendly,private.
Good Luck.

20 years ago
Hi,
The system.exit(1) command is a forcefull way of exiting from the program. This does not care to run the finally block. Hope the explanation given Peter should solve ur doubts.
Good Luck !!!
20 years ago

Hi,
U have made the objects of the type Hash Map static, However this does not mean that the built in non static methods of the class HashMap can be accessed without the HashMap object i.e for accessing a non static HashMap method, one always requires a HashMap object not a HashMap class variable.
Good Luck !!!
20 years ago
I think must have forgotten to give the arguments while running the program and hence the problem. Anyway such mistakes do happen in the initial learning stages. Good Luck !!!
20 years ago