Results 1 to 2 of 2

Thread: Ambiguos JAVA

  1. #1
    ALINAMARIA is offline Member
    Join Date
    Nov 2012
    Posts
    2
    Rep Power
    0

    Default 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

  2. #2
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,585
    Rep Power
    12

    Default 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

  1. Ambiguos JAVA
    By ALINAMARIA in forum New To Java
    Replies: 5
    Last Post: 11-27-2012, 12:09 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •