Stein Vom

Greenhorn
+ Follow
since Jun 07, 2002
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 Stein Vom

Hi Lino! Thanks for the reply.
I thought i'm the only one who is still in doubt about this topic.
I have seen other people discussing on similar topic. They were saying that null can be added. Ok, null can be added. But I want to know why we are not able to use something, what it is meant for?
Hi all!
I saw this program in some website. It says '? extends Instrument'. Doesn't that means that all the subclasses of Instrument and Instrument itself can be added here? Correct me if i'm wrong. Because it is showing compilation error. The compilation error was gone, when i changed the extends to super. But 'super' means that only the super classes can be added. I'm just confused.

public class Ques {
public static void main(String[] args) {
List<? extends Instrument> allInstruments = new ArrayList<Instrument>();
allInstruments.add(new Guitar());
allInstruments.add(new Violin());
}
}
interface Instrument {
public void play();
}
class Guitar implements Instrument {
public void play(){
System.out.println("Playing Guitar.");
}
}
class Violin implements Instrument {
public void play(){
System.out.println("Playing Violin.");
}
}
// end of program...
Hi all!
I have a query. Can one use the normal voucher to appear for the upgrade exam, instead of buying a new upgrade voucher. I have a normal voucher, which is going to expire in a few days.
Thanks in advance...
Age doesn't matter! What if i tell you that i have passed the exam and i am 7 years old.
21 years ago