Results 1 to 5 of 5
  1. #1
    nav1407 is offline Member
    Join Date
    Jul 2011
    Posts
    2
    Rep Power
    0

    Question **Multiple Choice Examination Questions** Would Like Answers Please

    Hello.... as the title says i would be ever so grateful if someone could provide me answers to the questions below ...

    Questions 1.15 to 1.19 refer to the following section of Java code:-

    public class xxx{
    public int aaa ;
    private String bbb;
    public xxx(){ }
    public int ddd(double eee) { }
    public void fff(int ggg){ }
    }
    public class yyy extends xxx{
    private double hhh;
    public yyy( ) { }
    private String zzz() { }
    }

    1.15 Which one of the following is the correct form of creating an instance of class yyy:-

    A z = new yyy();
    B z = new(yyy);
    C z = yyy new();
    D z = new.yyy();
    E z = yyy.new();

    1.16 Given that z is an instance of yyy. Which one of the following Java statements is valid:-

    A int s = z.ddd(3.0);
    B int s = yyy.ddd();
    C int s = xxx.ddd(3.0);
    D int s = ddd(z);
    E int s = z.ddd();

    1.17 Given that x is an instance xxx. Which one of the following Java statements is invalid:-

    A x.fff(3);
    B x.aaa = 3;
    C int i = x.aaa + 3;
    D x.hhh = 3.0;
    E double r = x.ddd(3.0);

    1.18 Given that z is an instance of yyy. Which one of the following Java statements is invalid:-

    A z.fff(2);
    B z.aaa = 123;
    C double a = z.hhh();
    D int r = z.ddd(2.0) + 2;
    E int f = z.aaa + 2;

    1.19 Which one of the following statements about this scenario is incorrect:-

    A yyy is a subclass of xxx
    B xxx is the superclass of yyy
    C yyy inherits aaa from xxx
    D xxx inherits bbb from yyy
    E each subclass has its own constructor

    and ....

    Questions 1.15 to 1.19 refer to the following section of Java code

    public class XXX {
    public int a;
    private double b;
    public void c(int d) { }
    }
    public class YYY extends XXX {
    public int d;
    private double e(String f) { }
    }

    1.15 Which one of the following is the correct form of creating an instance of class YYY:-
    A YYY z = new(YYY);
    B XXX z = XXX.new;
    C YYY z = new YYY();
    D XXX z = YYY.new();
    E YYY z = YYY(new);

    1.16 Given that y is an instance of YYY.
    Which one of the following Java statements is valid:-
    A y.d = 123.4;
    B y.e("Fred");
    C String x = y.a;
    D y.c(3);
    E double x = y.e;

    1.17 Given that x is an instance XXX.
    Which one of the following Java statements is invalid:-
    A int p = x.a + 9;
    B int p = x.d;
    C x.c(9);
    D x = new XXX( );
    E double b = x.a + 9.9;
    1.18 Given that z is an instance of YYY.
    Which one of the following Java statements is invalid:-
    A z.b = 123.4;
    B z.d = 1234;
    C z.c(1234);
    D int r = z.a + 9;
    E double r = z.a + 9.9;

    1.19 Which of the following statements about this scenario is incorrect:-
    A Objects of class YYY inherit attribute a
    B YYY is a subclass of XXX
    C c( ) is a method of objects of class YYY
    D Both classes have different constructor methods
    E Objects of class XXX inherit method e( )

  2. #2
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,253
    Rep Power
    25

    Default

    It would be quicker if you answered all of the questions and allowed us to correct your mistakes.

    In many cases have you written short programs and executed them to see what happens.

  3. #3
    nav1407 is offline Member
    Join Date
    Jul 2011
    Posts
    2
    Rep Power
    0

    Default

    hello sir thank you for replying these are examination questions, they will be in a written exam ... it would be beneficial to my revision if one could merely answer the questions

  4. #4
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,253
    Rep Power
    25

    Default

    See my post #2

  5. #5
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by nav1407 View Post
    hello sir thank you for replying these are examination questions, they will be in a written exam ... it would be beneficial to my revision if one could merely answer the questions
    Better to ban you and lock this thread. Please go elsewhere to cheat.

Similar Threads

  1. How to save the value for multiple choice answers
    By pink123 in forum AWT / Swing
    Replies: 1
    Last Post: 03-04-2011, 05:44 AM

Tags for this Thread

Posting Permissions

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