Vipin Das

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

Recent posts by Vipin Das

Why are you using this statement ?
for(int i=0;i<30;i++){
The statement for(Object o:set){ itself will print the contents of the hashset.

If you send a BetterString object to the equals method, then this line is going to return false no matter what.



Just to argue it wont be false all time, the following code will also return true. Append the following line to the padmanabhan's code.
I used kathy sierra & Bert bates book. It was a very nice book.
interface kumar;//assume
Kumar a=new Kiran();
Kiran is a class that implements interface kumar
then a instanceof Object is true....

It is true that the class Kiran is an instance of Object, but I think the interface kumar is not.


thanks,
Vipin
hi,
As far as I know, interfaces dont have a common base.
thanks,
Vipin
Congrats!!! shakeela
19 years ago
Hi
" public class B extends p1.A" with this statement u r inheriting the variable i. So u can directly access i in B. But u r accessing it through the object of A. Inside A it still has protected access.

Thanks and regards,
Vipin C. Das
Hi,
Is it possible to make a class non extensible without using the final key word?
class A{
void fun(){
System.out.println(" In method A ");
}

}

class B extends A{

void fun(){
System.out.println(" In method B ");
}
}

class C extends B{

void fun(){
System.out.println(" In method C ");

}
}

Is it possible to execute the method fun() of class A from a method in class C without creating an object of A in C? Please help.
hi,
The Thread class itself implements Runnable interface, and provide an implementation of run(). The run method simply execute the run method of a runnable object that is passed through it through the constructor of the Thread.
[ June 29, 2005: Message edited by: Vipin Das ]
Hi Chitra,
If u put " string " with spaces at both ends or a space at either end, the method will create a new string. But if u put like this "string" with no spaces in the end, it will return the same string, which is already in the string pool. That is why it prints "equals". If u have any doubt in string methods, it is better to have a look at the source code.
Using System.gc() you can just request to run the garbage collector. It may or may not run.
public static void main(String args[[]){
new xyz();
System.gc();
//if gc runs it will garbage collect the above object


}
class xyz{
String p[];
xyz(){
p = new String[200];
}
}

[ May 26, 2005: Message edited by: Vipin Das ]
[ May 26, 2005: Message edited by: Vipin Das ]
hi all,
i cleared the exam with 85%. Thank u very much for ur valuable help.
-vipin
20 years ago
Hi,
when your program runs 2 thread objects will be created, extThread1 and

extThread2.Then first thread comes give a notify() and come to the wait() and starts waiting on the extThread1 object. The second thread pass through the above steps and start waiting in the extThread2 object.
The notify of the first thread will be effective on the second thread only if they notify and wait on a common object. Here they are waiting and notify on themselves. Therefore there wont be anyo effect.
Even if you correct that problem, the second thread will wait for ever since no thread will be there to notify it. Now modify the program yourself.