samanchi snigdha

Greenhorn
+ Follow
since Mar 22, 2007
Merit badge: grant badges
For More
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 samanchi snigdha

Hello;

My understanding in declaring an anonymous array is

new <datatype>[] = {"values seperated by comas"}

I've written a sample code like this :



It gives an error line 5 not a statement

Thanks in advance.
[ November 21, 2008: Message edited by: Martijn Verburg ]
15 years ago
The life cycle methods like applet,servlet does not have main method . Though Threads got life cycle method still we write main to get execute. What is the difference between Threads and Applet,Servlet life cycle methods.
16 years ago
why should we call Threads run() method only through start() and not directly like threadob.run().

Pls reply n Thanks in advance
Both Comparable and Comparator are interfaces; then how is that we can overide compare() method of Comparator many times and we use compareTo() method belonging to Comparable only once?

am not sure my understanding abt this concept is clear or not!!!
Thq Jesper Young for explaining so clearly.
thanq Raghav and Mamun. got to know the concept =)
Hi mamun;
s there is local to main s in try block is local to try something called shadowing concept works here(right?) so i think it shud be giving null as answer. If at all printing of "s" is in try block itself it shud be giving an ouput as "b". According to my understanding..
Hi mamun;
s there is local to main s in try block is local to try something called shadowing concept works here(right?) so i think it shud be giving null as answer. If at all printing of "s" is in try block itself it shud be giving an ouput as "b". According to my understanding..
"It is appropriate to use assertions to generate alerts when you reach code that should not be reachable."

I did not understand this stmt. What is unreachable code and how can we ever throw an assertion to such a code. can anyone help me in clearing this doubt?
class Master
{
String doFileStuff() throws FileNotFoundException
{
return "a";
}
}

class Slave extends Master
{
public static void main(String [] args)
{
String s = null;
try
{
s= new Slave.doFileStuff();
}
catch(Exception e)
{ s= "b";}
System.out.println(s);
}
String doFileStuff()throws FileNotFoundException
{
return "b";
}
}

In the above pgm the stmt; s = new Slave().doFileStuff() ; assigns a value to s. And i think it is a local variable and its scope shud be only tot hat particular try block hows is taht i am gettin output as b. i think it shud "null".as s = b is limited to try block only and it is considerd as local variable.
A class that is abstract but has provided the implementation of all its methods.it contains main method.why cant it be executed?It is giving exception though the file name and class name are the same?
16 years ago
From K & B i've read Interfaces shud typically be adjectives like serializable, Runnable etc...
Then what abt interfaces like Vector, Map,List are they adjectives?