Javed Khan

Greenhorn
+ Follow
since Nov 25, 2000
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 Javed Khan

Hi Sonu,
It is true.All the questions clearly depicts the number of correct choices.Also if the question has two choices as the correct answer we cannot choose more than two.The exam simulator does not accepts the answer.
Best of luck.
regards
Javeed
Hi all,
It's nice to interact with you after long time.I passed SCJP2 last week.During my studies i found only few chapter-wise mock exams.So i prepared the chapter-wise mock exams for the ease of study.I have launched a website where there are collection of resources.you can check it out here
http://www.javeedansar.domainvalet.com
Feel free to mail me for suggestions at javeedansar@yahoo.com
Best of luck.
regards
Javeed
Hi all,
It's nice to interact with you after long time.I passed SCJP2 last week.During my studies i found only few chapter-wise mock exams.So i prepared the chapter-wise mock exams for the ease of study.I have launched a website where there are collection of resources.you can check it out here
http://www.javeedansar.domainvalet.com
Feel free to mail me for suggestions at javeedansar@yahoo.com
Best of luck.
regards
Javeed
[This message has been edited by Javed Khan (edited January 07, 2001).]
Hi all,
I cleared SCJP2 yesterday with the score of 74% after two months preparation.I have taken about 50 mock tests before taking the exam,sorry to say that i have never experienced these type of quesitons in any of the mock exams.So study the concepts well,and these helped me a lot.Thanks to maha anna,Ajith,Bill and all of the fellow ranchers.
regards
Javed

[This message has been edited by Javed Khan (edited January 07, 2001).]
20 years ago
Vinod,what u said is correct.
If i changed the question as,
which of the following are reserverd words?
goto
const
continue
case
what would be the choices.(i'm totally confused with keywords and reserved words)
regards
Javeed
Hi all,
These are my scores in different mock exams.please say,whether am I ready for the exam or not.
Javaranch roundup game-97%
Marcus green 1-86%
Marcus green 2-86%
Jxam -81%
Mindq -90%
IBM -76%
Khalid -47%
applied reasoning-57%
The last two scores worries me a lot.Yes,i know that these are the toughest mock exams,eventhough i am not confident after these scores.
Looking forward for your suggestions.......
regds
Javeed
These are quesions from IBM mock exam.
1)Based upon the code below, which of the answers apply?
public class TestFrame extends Frame {
public TestFrame(String title) {
super(title);
enableEvents(AWTEvent.WINDOW_EVENT_MASK);
}

public void
processWindowEvent(WindowEvent we) {
System.out.println("Window event processed");
}
}
a) The window listener that has been added to TestFrame will be called on every window event.
b) This code will compile and run if a window listener is added to an instance of TestFrame.
c) An exception will be thrown if a window listener is added to TestFrame.
d) The window listener that has been added to TestFrame will never get called.
e) This code will not compile if a window listener is added to TestFrame.

Multiple Select - Please select all of the correct answers (this question has 2 correct choices).
2.The way to accumulate drawn objects on the screen is to: (choose only one)

a) Call update() from within repaint()
b) Call paint() from within update()
c) Call update() from within paint()
d) Call paint() directly
e) Call accumulate() from within paint()
My choice is c.

3.Methods for a Component are:

a) add()
b) setbounds()
c) setVisible()
d) setEnabled()
e) addComponent()

Multiple Select - Please select all of the correct answers (this question has 4 correct choices).

My choices are a,c,d and e.

4.To prevent code which follows a try block from being executed when an exception is caught, you can:

a) Code a return statement in the finally clause.
b) Code an end clause.
c) Call System.exit() in the catch clause.
d) Code a return statement in the catch clause
Multiple Select - Please select all of the correct answers (this question has 3 correct choices).


1.A class without a main method can be run by JVM, if its ancestor class has a main method.(main is just a method and is inherited).
What is meant by this?
2.Which is true?
Whether a finalize method is inherited from the Object class or declared in the Object class?

These are questions from MindQ's test.
1.

Which of the following are legal method declarations to add to the class Sub? Assume that each method is the only one being added.
a) public static void main( String args[] ){}
b) float methodTwo(){}
c) long methodOne( int c, long d ){}
d) int methodOne( int c, long d ) throws ArithmeticException{}
e) int methodOne( int c, long d ) throws FileNotFoundException{}
The answer given are a,b and e.I think choice d is also correct,there is no restriction to throw unchecked exception
when overriding in subclasses.

2.How many objects are eligible for garbage collection once execution has reached the line labeled Line A?
String name;
String newName = "Nick";
newName = "Jason";
name = "Frieda";
String newestName = name;
name = null;
//Line A
a) 0
b) 1
c) 2
d) 3
e) 4
The answer given is b.According to me the answer is a,because the ref name is assigned to anther object which is
referenced by ref newestName. So in order to make the object eligible for GC newestName also has to set to null.

3. What method(s) from the java.lang.Math class might method() be if the statement
method( -4.4 ) == -4;
is true.
a) round()
b) min()
c) trunc()
d) abs()
e) floor()
f) ceil()
The answers given are a and f.I don't agree with f,since ceil() returns only double and not int.(-4 is not equal to -4.0)

Correct me if i'm wrong!!

It's not fair to say that all interger types in java are signed. It is not true. JLS says that 'char' is unsigned and it is part of integral type. All numeric data types are SIGNED.
char is the only UNSIGNED integral type.
The following example may clear the confusion.
int i=-1; //compiles
byte i=-1;//compiles.
char i=1;//compiles
char i=-1;//Explicit cast needed to convert int to char,because char type is UNSIGNED
char i=(char)-1;//compiles fine.
Correct me if I'm wrong.
Hi all,
Which is true regarding the relation between reserved word and keyword?
reserved words are keywords but not vice versa.
reserved words are keywords and vice verse.
which one is true?
Hi,
These are questions from Jxam.
1.Given the following defenition
String s=null;
which code fragment will cause a NullPointerException to be thrown?
(a)if((s!=null)&(s.length()>0))
(b)if((s!=null)&&(s.length()>0))
(c)if((s!=null)|(s.length()>0))
(d)if((s!=null)| |s.length()>0))
(e)None of the above
The answer given is a,b,c,d.But I think choice b is wrong.The reason is,as LHS is false so the RHS does not needs to be
evaluated because of &&.This makes the entire expression to be false.
Correct me if i'm wrong.

2.Given the following ,what would be the correct answers?

class Test
{
int x=5;
static String s="abcd";
public static void method()
{
System.out.println(s+x);
}
}
(a)code fails to compile,because cannot make a static reference to non-static variables.
(b)compiles fine,if x is declared to be static.
(c)compiles fine by removing the keyword static from the declaration of method()
The answers are a,b,c.
I do not agree with c.The reason is eventhough by removing the keyword static from the method(),in the expression
System.out.println(s+x) s is a String declared as static.so code fails to compile,coz cannot make non- static reference to static
variables.
Am I correct?If not correct me.
Hi,
I found this line from Velmurugan's study notes.
Anonymous String objects(literals) may have been optimized even across classes.
Can anyone throw some light on this?
equals()is overridden only by String and Wrapper classes.Does File also override the equals() method.