Win a copy of Rust Web Development this week in the Other Languages forum!

atiqur rahman

Greenhorn
+ Follow
since Aug 30, 2003
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 atiqur rahman

I passed scjp 1.4 with 93%.
There are many people who make this dream come true. I remember the first days when I start learning java. That was my 6th semester in AIUB and the instructor was Rubaiwat Ferdows. I naver forget the joy I get from that class. From that time I wish to become a scjp.
My real preparation for this exam start much later when I meet with Mr. Muhammad Ashikuzzaman moderator jdiscuss he give me two book name(K&B, M&R) and two discussion forum name. I buy the two book and start with K&B.
Kathy Sierra & Bert Bates, the writer of the finest java book I have ever read. The book will not be what is it now with out the hummers. I surely enjoyed the Para ?We except checks and chocolates ? the main exam question patterns and difficulty are much like the questions in K&B. When I get the score the first thing I think is send Kathy some chocolates. As it is hard to send it from here I call wait on this object and when time come I will call notify on this object.
Special thank for Paul (jdiscuss) for building the mock exam JQ plus. It help me lot for preparing. I give eight complete exam from it and get 78% in one 80% in one 81% in four 85% in one and 90% in one.
The forum javaranch & jdiscuss is very helpful.

I give one exam of Marcus Green and get 93.33?% amazing thing.
Math.floor(marcus_exam_mark)
I get the Dan?s single topic & other exams. I give the single topic exam only. It surely build my confidence level.
I am very happy now after becoming SCJP an I am very much grateful to my Allah.
atick
17 years ago
Nice reply
Yogesh Chhawasaria
you can also do it like this:
class Outer {
static class Inner {
public void m() {}
}
}
public class TestClass {
public static void(String args[]) {
Outer.Inner in = new Outer.Inner();
//you do not need a outer class instance to instantiate a
//static inner class
in.m();
}
}
in page 505
If you have a reference to a thread t, and its run() method has finished, you can't say t.start(); you'll get a big fat runtime exception.
in page 508
If you invoke start() on a dead Thread instance, you'll get a runtime(not compiler) exception.
in page 536
You can call start() on a Thread object only once. If start() is called more than once on a Thread object, it will throw a RuntimeException.
Now consider the following code:

This program gives a runtime exception but if i remove the comment then it runs fine. When the comment is removed then the new thread must be dead, why should i don't get a runtime exception???
[ April 12, 2004: Message edited by: Barry Gaunt ]
String a = new String("AAA");
How many object is created?
Here we use new so if 2 object is created then is one is eligible for garbage collection?
simple rule for switch case:
you can only use constant or final variable as case argument.
about the original question:
String s1= "abc" ; 1
String s2= new String("xyz"); 2
s2=s1; 0
s1.toUpperCase(); 1
String s3="abc";0("abc" is already created)
String s4=s3.replace('a','A');1
so, i think it is 5
public class TestThreads {
public static void main(String args[]) {
new TestT2().doIt();
}
}
class T2 implements Runnable {
private int a;
public void run() {
System.out.println(a);
String s = Thread.currentThread().getName();
StringTokenizer st = new StringTokenizer(s);
a = Integer.parseInt(st.nextToken());
}
}
class TestT2 {
void doIt() {
T2 a = new T2();
Thread t1 = new Thread(a, "1");
Thread t2 = new Thread(a, "2");
Thread t3 = new Thread(a, "3");
t1.start();
t2.start();
t3.start();
System.out.println("======"+Thread.activeCount());
}
}
Ques:
When i run this class using textpad the result is 4
and when i run it by opening a dos shell in win98 mechine i got 5
Why??
is it possible to download all the question at a time.
is there any archive facility