Salim Mohamed

Ranch Hand
+ Follow
since Sep 19, 2002
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Salim Mohamed

Has anyone in ranch participated in any training or practicising or at least know NLP ? What is this all about ? Does this work ? Does it has anything to do with hypnosis ?

NLP trainers are too costly and charge anywhere between �1000 - �1500 for training in one specific skill set(which I am not planning to attend anyway ), butI am curious to know about this buzzword ...

Any help ?
20 years ago
I have a requirement to drag the objects from a JList and drop it into JTree. Multiple objects can be selected in the JList. When I drag the objects after multiple selection in the JList , the multiple selection is changed to single selection. Is there any reason for this ? Is this any security issue here ? If so , how could this be resolved ?
Thanks in advance.
22 years ago
I appeared for the SCJP1.4 exam last week and passed with score of 80%.
1.Javaranch is the best ! I didnt refer any other site other than javaranch.
2.I was consistently scoring 75% in Dan's mock. Thanks Dan ! it is a challenge to score higher in your mocks.
3.I took marcus green exam just 2-3 days before the exam and scored about 85+%.Thanks Green !
I had atleast 12 questions from the Threads I think the test takes one section and tests you aggressively. So watch out guys ..you never know which section will be tested. It could be java fundamentals or Threads .
Thanks for all the helping hands !
22 years ago
I missed it completely.Thanks Dan.Isnt there a rule that method cannot have the same name as the constructor ? Will the compiler be able to differentiate the mistake the programmer makes by adding a return type to the constructor ?
In the following piece of code why is not Base getting printed ?

Thanks in advance.
class thread extends Thread {
public void run(){
System.out.print("hi"+this.getName()+",");
System.out.print(this.isDaemon());
}
public void go(){
System.out.println("in go ..");
this.start();
}
public static void main(String a[]){
thread t1 = new thread();
thread t2 = new thread();
t1.go();
t1.setDaemon(true);
t2.run();
}
}
And the output is :
in go ..
Exception in thread "main" java.lang.IllegalThreadStateException
at java.lang.Thread.setDaemon(Thread.java:1097)
at thread.main(thread.java:17)
hiThread-1,false
Can anybody explain why it throws exception ? Why the main method continues execution even after the exception ?
Thanks in advance.
You can schedule your exam date and time at 2test. But you may need the voucher from Sun to schedule it. I scheduled it today (Thursday) and my exam is on Monday. Well , I am in NY and not CA I presume it should be similar in CA too.
[ January 02, 2003: Message edited by: Salim Mohamed ]
Thanks Jessica. Are there any mocks specially for Threads ?
Dan,
Are you saying that the code indentation wont be there in the real exam ?
Sarma,
Please check again. I tried the following piece of code and it compile fine :
class staticInitializer {
static{
xx=100;
xy=200;
}
static int xx;
static int xy;
}
Jessica,
Thats a good explanation for null.But , What is the difference between
Object o; // ??
Object o1=null; //A reference variable not referring to any object in the heap
Thanks in advance.
[ January 01, 2003: Message edited by: Salim Mohamed ]
Ranchers,
I have scheduled my exam next Monday.I have limited time to go through my materials.
1.Are there any topics that are tougher in the exam than Dan's or Marcus Green mock ?
2.Are there any Threads , Wrapper classes , Garbage collection , Collection framework questions available other than Dan's site ?
3.I am not comfortable with the anonymous classes. Any help on what I should look for ?
Thanks in advance.
Why the below piece of code prints R.printS1,S.printS2 ?
class R {
private void printS1(){System.out.print("R.printS1 ");}
protected void printS2() {System.out.print("R.printS2 ");}
protected void printS1S2(){printS1();printS2();}
}
class S extends R {
private void printS1(){System.out.print("S.printS1 ");}
protected void printS2(){System.out.print("S.printS2 ");}
public static void main(String[] args) {
new S().printS1S2();
}
}
When is the subclass method is called and when the superclass method is called ? What difference will it make it it is like
R r = new S();
r.printS1S2();
and why ?
Thanks in advance.
How can method m1() can return char whereas its "contract" is to return byte ?
static byte m1() {
final char c = 'b'-'a';
return c; // 1
}
static byte m2() {
final short s = 2;
return s; // 2
}
static byte m3(final char c) {
return c; // 3
}
static byte m4(final short s) {
return s; // 4
}
public static void main(String[] args) {
char c = 'd'-'a';
short s = 4;
System.out.print(""+m1()+m2()+m3(c)+m4(s));
}
}