Results 1 to 2 of 2
Thread: Ambiguos JAVA
- 11-13-2012, 08:21 AM #1
Member
- Join Date
- Nov 2012
- Posts
- 2
- Rep Power
- 0
Ambiguos JAVA
How can you define the classes Adult, Student and Engineer so that the next sequence to give compilation error only where specified?
class Test {
public static void main(String args[]) {
Adult a = new Student(); //without giving compilation error
Adult b = new Engineer();//without giving compilation error
a.explorare(); //without giving compilation error
b.explorare(); //without giving compilation error
a.afisare(); //without giving compilation error
b.afisare(); //compilation error
- 11-13-2012, 08:29 AM #2
Moderator
- Join Date
- Feb 2009
- Location
- New Zealand
- Posts
- 4,547
- Rep Power
- 11
Re: Ambiguos JAVA
Double post. Reply here: Ambiguos JAVA
@OP: Please don't post the same question twice.
It might help get more responses if you thought said what aspects of Java you thought might be involved. And why. And what you tried, and what happened when you tried that.
Similar Threads
-
Ambiguos JAVA
By ALINAMARIA in forum New To JavaReplies: 5Last Post: 11-27-2012, 11:09 AM


LinkBack URL
About LinkBacks

Bookmarks