would any1 be soo kind enuff to answer these questio for mee i have not a clue.. iv underlined what i deem too bee correct
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( )