hamid
310-025
77%
hi every expected java programmer
whish u all the best
i cleared the exam on 06-08-01 with grade 77%
i am also mcse. but this exam is not like a microsoft exam. its too much tough than that.following are the steps which help me passing the exam.
firt of all i study the "complete reference" not all chapter just related chapter. then i study "the complete java 2 certification study guide" by simmon robert and "a programmers guide to java certification" by khalid mughal.
at last i done different mock exams like morcus greens three exams and khalid mughals mock exams and four days before exam i study the sasasite.com questions
following are the question of exam which are right now in my memory.
prerequist: determination and hardworking
q#1-which are the reserved words in java(choose two).
ans. 1-implements, 2-default
q#2-out put of the following code on execution
int i = 1;
while(i){
do some thing
}
ans. code will not compile
q#3- when the object created at line 3 will elligible garbage collected.
1-public class foo{
2-public object m(){
3-object o=new float(2.14f);
4-object [] oa=new object[1];
5-oa[0]=o;
6-o=null;
7-return o;
}
}
i choose after line 6 which was wrong.
q#4-almost four question on overriding overloading which was very simple.
q#5-out put when execute the following code
public static void main(string arg[]){
try{
methoda();
}catch(ioexception io){
system.out.println("caught ioexception");
}catch(exception e){
system.out.println("caught exception");
}
}
public void methoda(){
throw new ioexception();
}
}
ans-compilation error
q#6 type in
system.out.println(6^3);
ans-5
q#7 which give output "true" (choose two)
integer i = new integer(5);
double d = new double(5);
long l = new long(5);
option given was
1-system.out.println(i==d);
2-system.out.println(d==l);
3-system.out.println(i.equal(d));
4-system.out.println(i.equal(l));
5-system.out.println(d.equal(l));
i think all give "false" output ,all wording is same as i write
i can not understand how he is asking about true, because no one giving true output.
q#8 type in, what was the result when the following code compile
string s = new string("xyz");
stringbuffer sb = new stringbuffer("abc");
s = s.substring(2);
system.out.println(s+sb);
i am not sure about this question.
q#9 what collection used when uniqueness rquired and retrieve in natural order
1-set
2-sortedset
3-map
4-collection
ans- i choose sortedset.
q#10 what will be output when compile the following code
public class x implements runnable{
private int x;
private int y;
public static void main(string args[] ){
x that = new x();
(new thread(that)).start();
(new thread(that)).start();
}
public synchronized void run(){
for( ; ; ){
x++;
y++;
system.out.println("x=" + x + ", y=" +y);
ans-value of x and y will be same on same and appears onece and will not twice
q#11 local classes can access only final variales(question was something like that)
three question about inner and anonymous classes
q#12 output when following code compile and execute.
public class foo{
public static void main(string[] args){
try{
return;}
finally{ system.out.println("finally.");}
}
}
ans-finally
q#13 what ensure j will be 10 at line 16
1 class a implements runnable {
2 int i;
3 public void run () {
4 try {
5 thread.sleep(5000);
6 i=10;
7 }catch(interruptedexception e) {}
8 }
9 }
10 public class test {
11 public static void main (string args[]) {
12 try {
13 a a = new a();
14 thread t = new thread(a);
15 t.start();
16
17 int j= a.i;
18 }catch (exception e) {}
19 }
}
ans-t.join
q#14 method of mousemotionlistener interface
a. public void mousedragged(mouseevent)
b. public boolean mousedragged(mouseevent)
c. public void mousedragged(mousemotionevent)
d. public boolean mousedragged(mousemotionevent)
e. public boolean mousedragged(mousemotionevent)
answer:
a
q#15 what will be the value of i
int i = 0xfffffff1
1-0
2-1
3-15
4-could not compile
q#16 valid class declaration
ans-//comments any where then package statement then import statement .
q#17 what will be the most suitable access modifier of method if we want to access in the class and all its subclasses
ans-protected
闽公网安备 35060202000074号