1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
oee [108]
3 years ago
13

Assume that the following code exists inside a method of MyClass, and that this code compiles without errors: int result = book.

getYearPublished();where book is an object of the Book class.Which of the following is not true about the getYearPublished method?(1 point)I. It is a mutator method.II. It is a public method in the Book class.III. It returns a String.1) I only2) II only3) III only4) I and II only5) I and III only
Computers and Technology
1 answer:
kicyunya [14]3 years ago
3 0

Answer:

Option (5)

Explanation:

Since, it is returning a value which is stored in a variable result which is of int type, that is why, III is wrong as it cannot return a string. Moreover, A mutator method is one which changes the value of a private member of a class and they don't return anything of any type. But the statement is returning a value of int type so, it cannot be a mutator method. So, I and III are not true. Since, object of book class is able to access that method , it must be a public method otherwise error would have displayed as objects of class has no access to their private members and can invoke public member functions only. So, II is true.

You might be interested in
What is the advantage of using the Publish Online option for sharing a calendar? It creates a web version that can be viewed by
kotykmax [81]

Answer:

its D. it allows a user outside an organization to view the calendar.

Explanation:

i just got it right on edge 2020.

7 0
2 years ago
Read 2 more answers
What does "CPU" stand for?
sergiy2304 [10]
Central Processing Unit
8 0
3 years ago
Read 2 more answers
Write 'T' for true and 'F' for false statements.
asambeis [7]
1-F
2-T
3-F
4-F
5-F
6 T
7-T
3 0
2 years ago
When a piece of shiny silver jewelry gets tarnished, what has happened?
makvit [3.9K]
A
because if you leave certain metals in the rain they tarnish or rust. think about how if you leave a bike in the rain for too long it will start to rust on the metal parts
6 0
3 years ago
Volume of a cuboid is 14400 ​
Yanka [14]

Answer:

WHAT?

Explanation:

8 0
3 years ago
Other questions:
  • 18) choose which article title would most likely be described by the database subject headings victims of famine, ireland, histo
    14·1 answer
  • 1. Write program, WriteData.java, that writes the following data to file books.txt. Include the semicolons. Fiction;Abraham Linc
    11·1 answer
  • When planning your website, what is one of the key things you should consider
    12·2 answers
  • Sam has created a fashion website. There are many subscribers to his website. He has added new blogs, pictures, and articles abo
    13·1 answer
  • To accomplish a certain task when you would rsther be doing something else is an example of
    9·1 answer
  • Use the variables k and total to write a while loop that computes the sum of the squares of the first 50 counting numbers, and a
    6·1 answer
  • What is the definition of a nested function?
    8·1 answer
  • Anne wants to hide her age by converting it from 13 to 1101. Which number system is Anne converting to?
    13·1 answer
  • The most common markup language used with web pages is ___________ Question 4 options: A. HTML B. VRML C. Javascript
    13·2 answers
  • A block signature indicating that a text message was typed on a mobile device is an example of ____________.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!