Question: object oriented Choose the correct answer from the multiple choice 5. What will be the output of the following Java program? public class Animal{ public

 object oriented Choose the correct answer from the multiple choice 5.

What will be the output of the following Java program? public class

Animal{ public int age; public int position; public Animal({ age=1; position=2; }

} public class Bird extends Animal String name; public Bird(){ supero: }

object oriented Choose the correct answer from the multiple choice

5. What will be the output of the following Java program? public class Animal{ public int age; public int position; public Animal({ age=1; position=2; } } public class Bird extends Animal String name; public Bird(){ supero: } } public class test public static void main(String [] args) { Bird obj= new Bird(); System.out.println(obj.age + "" + obj. position); 3 } 3) b) 21 Compilation Error Runtime Error 12 Bos bural cl 6- Following classes are given. In the test class the following object is created. T objectT=new T ("Object"); What will be displayed on the screen? public class A{ public Alt System.out.print("A"); } public class C extends A{ public COA System.out.print("C"); } public C (String name) System.out.print(name); } 1 public class Textends C public Tl) { System.out.print("T"); + public T (String name) super(name): System.out.println("T constructed"); 1 1 a A Object T constructed A Object Object T constructed T constructed Bobina 100 Transiate STIX | Login https://obs.us 7. Date class implementation is given in the figure. Which of the following correctly constructs a Date object? (1) Date d = new (2, 13, 2020); (11) Date d = new Date(2, 13, 2020); (III) Date d; d = new (2, 13, 2020); (IV) Date d; d = Date(2, 13, 2020); (V) Date d = Date(2, 13, 2020); public class Date private int day: private int month; private int year; public Date() public Date (int mo, int daint ya } public int getMonth 7 public int getDay public int getrear Returns string representation ct Date asi/d/y pubic sting otring Which method can be used to create an input object for file temp.txt? I. new Scanner("temp.txt") II. new Scanner(temp.txt) III. new Scanner(new File("temp.txt")) IV. new Scanner(File("temp.txt")) a) IV b) 11 C) d) . Bo brak Kapat Sini Bitir 8/25 Sonraki

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!