Harshit Sethi

Ranch Hand
+ Follow
since Jul 16, 2010
Delhi
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 Harshit Sethi

Are there any charges to fully activate the exam lab ,the one i have is in try mode.
Can Someone give me the link of some good mock tests?

I know that there are a lot of mock tests here ,but i want to know about some good mocks related to SCJP6 syllaybus.Some mock tests have questions from awt,applet etc.
Tell me from your experience.
In exam you will be asked for the possible answers and those can be more than one.So that makes it a mutiple choice question.
It's simple,just know one thing that calling the start method on instance of a thread may or may not immediately invokes its run method in seperate call stack.It just moves the thread from new state to runnable state.After that it depends on scheduler to select the execution of a thread.


Even if you call the start method it doesn't gurantee that the thread will be immediately moved into running state.What it gurantees is that the thread will be moved into runnable state and will become eligible to be selected by the scheduler.
Let's say super class is Animal and has a method with signature public Animal aMethod().

If Dog is subclass of animal then if the Dog class overrides the aMethod() ,the its return type can be Animal or Dog or whatever that is Subtype of Animal.
So this is an error in kathy sierra.Good work.
enhanced for loop was introduced in java 6 to specifically iterate over arrays and collections .Before that and even in java 5.0 we used basic for loop .
hi,Mohit.After the 5th line ,the thread of b also becomes runnable but there is no gurantee that JVM will select this thread That's upto the scheduler.In other JVM or even in another execution of program,the output may change .If you want a specific thread to run you can influence JVM by methods like sleep,setPriority etc.


So ,the main point is even if you start a thread that doesn't mean it will be in running state.It comes into runnable state and after that which thread executes for how much time is upto scheduler.
Can you post the code showing the class and method which is called ,it's not possible to predict the behaviour of this code without that.
Yes ,i have 2 books .One is the soft copy and the other is hard copy .I am asking question from the hard copy but the questions in soft copy are different.I think because that would be an old edition.
I am sorry deepak ,i can't write these long codes here.I tried to copy paste them from pdf of kathy sierra i have but the questions are different in the previous edition.So anyone who is having the latest Kathy sierra book,post a solution here and help me get through this concept.



Waiting for Enlightenment.
okay ,deepak just wait a sec.I am really in a great need for their explaination.
Need your help to understand whats the concept behind these question.I read this chapter very seriously but still i am not able to think whats going on in these question.It would be really nice if someone explains me what are the rules for declaring classpath in java and javac commands.
yeah and by covariant returns i mean that you can declare the return type to be the same as that of superclass' method or a subtype of that and that's possible if you are returning a reference.
Actually i am having problem with the type of questions in which one class in some package needs to access some other class in other package for example it inherits that class,then what statements can be used to compile and run the program.