refer to the following Date class declaration public class D

refer to the following Date class declaration: public class Date {private int day; private int month; private int year; public Date()//default constructor} ...} public Date(int no, int da, int yr)//constructor {...} public int nonth()//returns month of Date {...} public int day()//returns day of Date {...} public int year()//returns year of Date {...}//Returns String representation of Date as \"n/d/y\". e.g. 4/18/1985. public String toString() {...}} Which of the following correctly constructs a Date object in a client class? Date d = new (2, 13, 1947); Date d = new Date(2, 13, 1947); Date d; d = new (2, 13, 1947); Date d; d = Date(2, 13, 1947); Date d = Date(2, 13, 1947);

Solution

Answer is B) Date d = new Date(2,13,1947);

Explaination:

to create an object we use new keyword.

example

and to create an object and to call contruct .

so in above statement .answer is

Date d = new Date(2,13,1947);

 refer to the following Date class declaration: public class Date {private int day; private int month; private int year; public Date()//default constructor} ...

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site