Computers and Technology

Consider the implementation of the Date class shown below. public class Date
{
private int myDay;
private int myMonth:
private int myYear;

public Date( )
{ /* implementation not shown */ }

public Date(int mo, int day, int yr)
{ /* implementation not shown */ }

public int getMonth( ) //returns month of date
{ /* implementation not shown */ }

public int getDay( ) //returns day of date
{ /* implementation not shown */ }

public int getYear( ) //returns year of date
{ /* implementation not shown */ }

//string representation of Date as "m/d/y", e. g. 4/18/1985
public String toString( )
{ /* implementation not shown */ }
}
A separate client/tester class instantiates a Date object named d with the following Java statement:

Date d = new Date (1, 13, 2002);
Which of the following subsequent code segments will cause a compile-time error?

String s = d. toString();
Date e = new Date(1, 13, 2002);
int y = d. myYear;
int x = d. getDay();

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 12:30, legend101xD
Animations and transitions are added from the
Answers: 1
image
Computers and Technology, 23.06.2019 21:30, mariah10455
Write a fragment of code that reads in strings from standard input, until end-of-file and prints to standard output the largest value. you may assume there is at least one value. (cascading/streaming logic, basic string processing)
Answers: 3
image
Computers and Technology, 23.06.2019 21:40, jeovontamarley
language consists of basic components, and they are called a. 3; mental images, concepts, and speech b. 2; language acquisition and linguistic relativity c. 3; heuristics, algorithms, and analogies d. 4; phonemes, morphemes, syntax, and semantics e. 2; words and grammar
Answers: 3
image
Computers and Technology, 24.06.2019 05:30, lolololol21
Cómo pongo un tomo de llamada sin pagar?
Answers: 1
Do you know the correct answer?
Consider the implementation of the Date class shown below. public class Date
{
private...

Questions in other subjects: