Gautam Sewani

Ranch Hand
+ Follow
since Apr 19, 2002
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 Gautam Sewani

It has been some time since I have been using java,but its a shame that I dont know how to use a JIT compiler/interpreter.Can anyone help me?
Another thing,does anyone know how to configure internet explorer to work on a particular versoin of JRE.I have JRE 1.1 and JRE 2,now I want IE to run programs through JRE2.How do I do that?
16 years ago
Well,I know that JLS is pretty dry reading,and as Corey said,its great to be used as a reference,but I read it straight through before giving the exam.
The thing is that if you read JLS,then you will get great marks in your mock exams,and that will raise your confidence for the real exam.But be careful,it is not very interesting to read,so try it,and if you can bear it,then read it!
I suggest that you should read Mughals Book.Thats an excellent book.If you take the marcus green exam and get above 80% in your first attempt,then you are all set to go.Take valentin's exam,and if u pass,and i guarantee that you will pass the real exam.
I got the same marks which u got in the final exam of R&H books,and in the real exam,I got better marks!


1. public void run() has to appear like this in code which implements Runnable.It's signature must stay the same and with no args added to the param. Is this correct?


Thats correct.


2. Do the same rules apply to code that extends Thread as well, or is it OK if we even don't include this method in the code - will it give compile time error?


No,the same rules dont apply for the code that extens Thread,as thread as already a blank run method defined,and so the code which does not define a run method explicitly will not give compile time errors.


3. I know that Runnable is an abstract class and that the run() method is abstract, and can therefore understand that it must appear in code that implements Runnable. If you didn't incl run(), would that mean that you'd have to declare the class that implements Runnable as abstract?


First of all,runnable is an interface and not an abstract class.Rest everything is correct about your statement.


4. Am I right in saying that Thread class already inherits from Runnable? If that's the case what implications does that have on Thread class?


The thread class implements runnable.It does not have any particular implications,except that a thread class also can be used as another thread.
Well,I began learning computers through c and c++.After I had learnt the basics,I migrated to java,then prepared for SCJP and passed it.
Now I wanna go back to c and c++,advance to vc++ and more.
Can anyone tell me a good indepth tutorial for c and c++,whcih also covers hardware interaction through c in a simple way?
Well,more ideas on what should I do now are also welcome.Thanks
Gautam
The last reply was the only correct reply!
Check out Maha Anna's mock exam list,I tell u,that list is the ultimate mock exam list and u wont need to ask this question ever again after reading that List.
Reagards
Gautam
I have some experience in Java,but I dont think I am that good in OOPS.Can anyone please suggest me a detailed oops tutorial available on the net?
I dont wanna buy a costly book for that.
Pls help me
Hi pohying hip,
As you know,expressions in java are evaluated from left to right,therefore the above output occurs.Lets examine it case by case:

In this case,first 1+2 is evaluated,which is equal to 3,then since the next argument is a string "3",therefore the previous 3 is converted to a string and joined to the String "3",which gives the output 33.

First "1"+2 is evaluated,which gives "12".Then "12"+3 is evaluated,which gives,123.
I hope that helps
Gautam
In such a case,will my java program not throw any Exception? And what is the exact component which I need to install? Is it TCP\IP networking?
Hi everyone,
I have just started learning socket programming in java.
I created a client server application,in my computer institute.
It works fine on the LAN,but when I ran it on my standalone pc,it did not work.
My pc has windows 98 operating system.
Do i need to install any additional protocols to make my java programs work?
Its easy to convert a hexadecimal into a decimal.
For eg. lets take your number,0x1c
first multiply the last digit of the hexadecimal number by 16 to the power 0.
c=12
12*16to the power 0=12*1=12
then multiply the next digit by 16 to the power 1
1*16 to the power 1=1*16=16
Then add the products which you got after multiplication.
16+12=28.Thats it!
If there are more digits,then keep on increasing the power.
For eg,if there was a third digit 2 in your number,then it would be multiplied by 16 to the power 2.
I hope that helps.
By the way,there have been numerous threads in this forum,which have talked about this topic.
You can search for them.
Regards
Gautam
Hi Dave,
I dont think the above code overrides the start method.The worker class implements the Runnable interface and the runnable interface doesn't even have a start method.So I dont think it is the case of overriding.
The problem coz of which the thread does not start is because the start method on the Thread is not called.For eg,a one line addition would make the worker class execute the run method.

When the start method of this worker class is called,the run method will definitely be executed.
Please correct me if I am wrong
Hi Rob,
I think the answer should be a and e.
As you said,there is no guarantee,that yield() will definitely stop a thread from executing.
So c is not a corrent answer.
suspend() is a deprecated method,and I was told that whenever a deprecated method is included in the answer,it cannot be one of the correct answers.
So the only options which will definitely stop a thread from executing are wait() and sleep().
Am I correct?
Hi Akhilesh,
The code compiles because temp variable is initialized in the if condition as well as the else condition.If the if condition is executed,temp will be initialized,and if the if condition is not executed,then also temp will be initialized.Thats why,there is no compile time error.
For more information,you can read the JLS section of unreachable statements and definite assignment.Those are very informative chapters and will certainly improve your knowledge.