Question: object oriented choose the correct answer 10- Date class implementation is given to you. A client program creates a Date object as follows: Date d




object oriented choose the correct answer
10- Date class implementation is given to you. A client program creates a Date object as follows: Date d = new Date(1, 13, 2020); Which of the following subsequent code segments will cause an error? (1) Strings = d.toString(); (11) int x = d.getDayO; (III) Date e = new Date(1, 13, 2020); (IV) int y = d.year; public class Datet private int day: private int month; private int year; public Date() } public Date(int mo, int da, int yr) | public int getMonth() 1 public int getDay) ! public int getYear() // Returns string representation of Date as "m/d/y" public string tostring Consider that you want to extend AClass to BClass. BClass will have a third int instance data, z. Which of the following would best define B Class' constructor? public class Aclass { protected int x; protected int y; public Aclass (int a, int b) { X = a; Y = b; } 1) public BClass(int a, int b, int c){ super (a, b, c); } II) public BClass(int a, int b, int c){ z = C; } public BClass(int a, int b, int c){ super (a, b); z = c; } IV) public BClass(int a, int b, int c){ super : 1 12- A new student object named "stu" has been created below. Student stu= new Student("Ali", 123456); Which of the following statements adds this object to the ArrayList named StudentList? I) stu.add() II) stu.add(StudentList) III) StudentList.addo IV) StudentList.add(stu) a) IV b) III C) 11 Ceva Bo birak public class Student { public void play() { System.out.print("play"); study (); } public void study () { System.out.print("study"); } 3 public class Uskudarstudent extends Student public void play() { super.play(); System.out.print("websurf "); 1 7 public class Test { public static void main(String[] args) Uskudarstudent k new Uskudarstudent (); k.play(); a b) C Websurf play study websurf play study play websurf Bos bra
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
