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
Ainat [17]
2 years ago
9

Write a class named Book containing: Two instance variables named title and author of type String. A constructor that accepts tw

o String parameters. The value of the first is used to initialize the value of title and the value of the second is used to initialize author. A method named toString that accepts no parameters. toString returns a String consisting of the value of title, followed by a newline character, followed by the value of author.
Computers and Technology
1 answer:
andrey2020 [161]2 years ago
3 0

Answer:

The code to this question can be given as:

Code:

public class Book  //define class.  

{

private String title, author;   //define variable.

Book(String a, String b)  //define parameterized constructor.

{

title = a;   //holding value.

author = b;

}

public String toString()  //string function

{

return title + "\n" + author;    //return value.

}

}

Explanation:

In the above java code firstly we declare the class book that name is already given in the question. Then we declare the private variable that datatype is string author and title. Then we declare the parameterized constructor. In the parameterized constructor we use the private variable for hold constructor parameter value. Then we declare the tostring() function in this function we return value of the title and author variable.

You might be interested in
9. Government and corporate officials concerned about security threats do not bring their own cell phones or laptops when travel
tatuchka [14]

Answer:

True

Explanation:

It is known as Don-Not-Carry rules are implemmented to avoid

-Unauthorized full disk copies (it have been made while the laptop owner was out of the hotel room on overseas travel)

-Laptops steals

- Monitoring by third parties of wireless using.

3 0
3 years ago
You can select slide objects in order to delete them simultaneously by pressing the _____ key as you click each object. select o
HACTEHA [7]
D tab that is the key you would need to use in order to do that
6 0
3 years ago
Read 2 more answers
Six external parts of a computer system, which are output and which are input devices.
Zigmanuir [339]
1. The keyboard is an example of an input device.
2. A mouse is an example of an input device.
3. Display Monitors are examples of output devices as they display information.4. Audio speakers are examples of output devices.5. Headsets with microphones are an example of both an input and output device as they allow sound to be inputted and receive sound.6. Printer/Printer scanner. A printer would be an example of an output device, however, a printer scanner combination would be both input and output.

3 0
3 years ago
The Bradshaw family has $200,000 of total assets and $140,000 of liabilities. What is their net worth?
3241004551 [841]

Answer:

$340,000 is there net worth

Explanation:

$200,000+ $140,000 = $340,000

5 0
3 years ago
A portable electronic device that can be used in an emergency to stop someone’s heart from going out of rhythm is called a/an
JulsSmile [24]
It is called a Heart pace maker
7 0
3 years ago
Read 2 more answers
Other questions:
  • 1. Which plot element is typically the turning point and the most intense moment of a story? (1 point)
    11·2 answers
  • Help me out here pleaseeeee
    9·2 answers
  • An ironworker standing 30 feet in the air is safe wearing a full body harness that is not tied off
    15·2 answers
  • Which is a basic job requirement for a career in corrections services?
    13·1 answer
  • What privacy risks do new technologies present,<br> and how do we decide if they're worth it?
    11·1 answer
  • Did anyone else remember that Unus Annus is gone? I started crying when I remembered.... Momento Mori my friends.... Momento Mor
    9·2 answers
  • 3. State whether the given statements are true or false. a. The computer is called a data processor because it can store, proces
    13·1 answer
  • Please complete the following questions. It is important that you use complete sentences and present the questions and answers w
    12·2 answers
  • Please help me I need a help
    13·1 answer
  • What are two potential benefits of using calendar-synchronization tools like calendly
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!