Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Programming Languages 12th International Symposium Dbpl 2009 Lyon France August 2009 Proceedings Lncs 5708

Authors: Philippa Gardner ,Floris Geerts

2009th Edition

3642037925, 978-3642037924

More Books

Students also viewed these Databases questions

Question

8. Managers are not trained to be innovation leaders.

Answered: 1 week ago