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]
3 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]3 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
1- How should an operating system support communication between applications? explain your reasoning?
Luba_88 [7]

<u>Explanation:</u>

An operating system support communication between applications through regions of memory shared between the applications. For example, a computer's RAM (random access memory) allows each running application to use a portion of the computer's memory.

7 0
3 years ago
Which feature of the Excel window should I use to perform an action
Ne4ueva [31]
It depends on which action. 
5 0
3 years ago
Based on the Standards, the statement, "Competition for computer time during periods of high demand had become intense because o
frozen [14]

Answer:

cause

Explanation:

According to my research, I can say that based on the information provided within the question this is an example of a "cause". This refers to something that makes something else happen, and is usually stated by the word "because". For example in this situation the a "planned increase in the use of the computer by operating departments" caused a "Competition for computer time during periods of high demand to become intense".

I hope this answered your question. If you have any more questions feel free to ask away at Brainly.

3 0
4 years ago
President Roosevelt's Fireside Chats were:
larisa86 [58]
C. Entertaining radio shows that families listened to in the evening. He did these chats to inform the public on what he was going to do about the problems facing the public.
3 0
3 years ago
Read 2 more answers
Discussion Topic
BabaBlast [244]

Answer:

Social media positively affects and impacts the process of globalization. ... Global communities is a social infrastructure tool and as social media helps in strengthening social relationships and bringing people and communities together it leads to creating a string global community.

7 0
3 years ago
Other questions:
  • If you delete an imessage does the other person see it
    12·1 answer
  • Binary is best interpreted by a computer because?
    8·2 answers
  • What happens as the key length increases in an encryption application?
    8·1 answer
  • When you use an external style sheet with an HTML document, you get all but one of the benefits that follows. Which one is NOT a
    15·1 answer
  • Give an example of a situation in which a compromise of Confidentiality leads to compromise in Integrity.Situation where confide
    8·1 answer
  • Science Help
    11·1 answer
  • 12. In cell A14, use the INDEX function and structured references to display the value in the first row and first column of the
    8·1 answer
  • In one to two sentences, describe how you would add a new slide to your presentation.
    11·2 answers
  • CSNET Stand for in a computer
    11·1 answer
  • How to do or create a shepard tone using additive synthesis in Pure Data. Please help, desperate!!
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!