Computers and Technology
Computers and Technology, 27.03.2021 01:10, mdot8890

Consider the following class definitions. public class Computer { private String memory; public Computer) { memory = "RAM"; } public Computer (String m) { memory = m; } public String getMemory () { return memory; ) } public class Smartphone extends Computer private double screenWidth, screenHeight; public Smart Phone (double w, double h) super("flash"); screenWidth = w; screenHeight = h; } public double get ScreenWidth() { return screenWidth; } public double getScreenHeight() { } return screenHeight; } The following code segment appears in a class other than Computer or Smartphone. + Computer myPhone = new Smart Phone (2.55, 4.53); System. out. println("Device has memory: " + myPhone. getMemory () ", screen area: " + myPhone. getScreenWidth()* myPhone. getScreenHeight() + " square inches."); The code segment is intended to produce the following output. Device has memory: flash, screen area: 11.5515 square inches. Which of the following best explains why the code segment does not work as intended?A. An error occurs during compilation because a Smartphone object cannot be assigned to the Computer reference variable myPhone. B. An error occurs during compilation because the Smartphone class has no getMemory method. C. An error occurs during compilation because the getScreenWidth and getScreenHeight methods are not defined for the Computer object myPhone. D. An error occurs at runtime because the Smartphone class has no getMemory method. E. An error occurs at runtime because the getScreenWidth and getScreenHeight methods are not defined for the Computer object myPhone.

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 16:50, jaueuxsn
3(c). is the following command correct? if not, correct the syntax and explain your answers. you can just rewrite/correct only the wrong parts. (4) select p#, city, zipcode, count(*) from client c, property p, viewing v where c. c# = v. c# and v. p# = p. p# group by p#, city having count(*) > 3;
Answers: 1
image
Computers and Technology, 22.06.2019 17:50, ImBADatmath8743
Farah works in an office with two other employees. all three share a printer and an internet connection. the utility that makes this possible is defragger quicktime soho winzip
Answers: 1
image
Computers and Technology, 23.06.2019 14:30, kodak0531
Which of the following would not be considered a pc? a. mainframe b. desktop c. tablet pc d. laptop
Answers: 2
image
Computers and Technology, 25.06.2019 08:20, jake2124
With technology, information is sent to users based on their previous inquiries, interests, or specifications.
Answers: 2
Do you know the correct answer?
Consider the following class definitions. public class Computer { private String memory; public Comp...

Questions in other subjects:

Konu
Mathematics, 22.05.2020 23:57