aspose file tools*
The moose likes Mock Exam Errata and the fly likes JQuest Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Mock Exam Errata
Bookmark "JQuest " Watch "JQuest " New topic
Author

JQuest

madhuri vl
Ranch Hand

Joined: Jan 17, 2001
Posts: 86
Here are 2 Q from JQuest
What should be at //A to output running
class RunThread implements runnable {
RunTest rt = new RunTest();
Thread t = new Thread(rt);
// A
}
public void run() {
System.out.println("running");
}
void go(){
start(1);}
void start(int i) {
}
a) t.start();
b)rt.start();
c)System.out.println("running");
d) start(1);
a,c are the given answers. Why is c? I feel only a
Here is my 2nd Q
2) class A {
public void method(int i, floatf){
//Some code
}
}
public class B extends A {
// Comment here
}
What should be // here
a) void method (inti,floatf)
b) public void method(inta,floatb)
c) public void method()
d) protected int method(floatb,int a)
Answers given are b,c,d. i feel only b,c
Can anybody explain?
Madhuri.

madhuri.
Lokesh Mahajan
Greenhorn

Joined: Feb 01, 2001
Posts: 22
Hello Dear
In first example insted of RunTest it should be RunThread,
Problem is what is going to print "running",so if you give just simple System.out.println("running"); it is going to print "running", here it is not going to call run method,so only single "running"is the output.
so both the option given are correct.
About 2 question.
option d is also right because it is the case of overloading ,
option b & c are the case of overriding.
love
Lokesh
madhuri vl
Ranch Hand

Joined: Jan 17, 2001
Posts: 86
Hi,
Thank you. so changing the order of the parameters is Overloading.Ok
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JQuest
 
Similar Threads
JQuest
Another Question From JQuest Mock Exam...
question from Jquest on Threads
Threads
JQuest Cert Simulation Question