Xyz Abc

Greenhorn
+ Follow
since Aug 24, 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 Xyz Abc

[QB]I know what a class declaration is. But what exactly is an object declaration? Can anyone give me an example?
Thanks.

2nd statement:
s = s + �sasi�;
here, jvm will create "sasi" object and it is concated to the string which is in s. but strings are immutable. so the result of "Srisai" is created within new object and then its reference is assigned to s. so here 2 objects ("sasi" and "Srisasi") are created. upto here 3 string objects are created.



I didn't realise that creating "sasi" actually creates a new object!!
Amit is right, you need to instantiate test by using new.


[ December 01, 2007: Message edited by: Xyz Abc ]
Still didn't understand, which are the 2 objects here?
I think I have suppressed the option to show that dialog box sometime back

Anyway I know now!!
Hey Doug,

Thanks for the reply! I wouldn't mind using either of them, was just wondering which one's better and what everyone else does.
[ December 01, 2007: Message edited by: Xyz Abc ]

when we can say something like
List<? extends Number> myList1 = new ArrayList<Number>();
does it mean 'a class is subclass to itself'?



It means that any class which extends Number can be considered.


when we can say something like
List<? super Number> myList2 = new ArrayList<Number>();
does it mean 'a class is superclass to itself'?



No, it doesn't mean a class is a superclass to itself, it means any class which is a superclass of Number, that the list can be of that "type".

Guys please correct me if I'm wrong!
[ December 01, 2007: Message edited by: Xyz Abc ]
I actually figured out what is wrong with my Eclipse. It shows the error happening in the Problems tab but also compiles and prints something to the console. Is this a problem with my compiler?
Can anyone please tell me how I should set up the classpath? And if it's better to do it that way?
[ December 01, 2007: Message edited by: Xyz Abc ]
You know the weirdest thing is, its still compiles fine
Hi, abstract methods don't have a body and should end in a semicolon when described in an abstract class, but one big doubt.

What happens if you do declare it this way?

public void jump();

I tried it and there is NO COMPILER ERROR

Also, if I try marking a method as abstract and don't mark the class as abstract there is no compiler error again. My program runs fine.

Am I doing something wrong???
Please help!!

Thanks,
Nicole.
Sorry about that. I am new here.