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
What does server manager utility do
zhenek [66]

Answer: is a tools to view and manage sever.

6 0
3 years ago
What option do you use to create an urgent presentation
Art [367]
Microsoft power point, ya que es muy facil de manejar y pueden realizarse presentaciones en menos de 20 minutos
3 0
3 years ago
Short note on where do we use electronics in daily life
Nookie1986 [14]

Answer:

our laptops to do school work etc

our phones- use them everywhere

Explanation:

7 0
3 years ago
Is used for finding out about objects, properties and methods​
frozen [14]

Answer:

science

Explanation:

6 0
3 years ago
This software application has many unique features like animation, slide transitions, preloaded templates, and themes.
Aliun [14]

Answer:

Explanation:

It's c

4 0
3 years ago
Other questions:
  • Which translator program reads small portions of a program at a time, translating them into machine instructions which are then
    12·1 answer
  • A consumer purchases an exploit from the dark web. The exploit targets the online shopping cart on a popular website, allowing t
    5·1 answer
  • 15 POINTS COMPUTER LITERACY <br> The range A2:A4 has how many cells<br> -2<br> -4<br> -6<br> -8
    14·1 answer
  • Domain of (x+8)/(x(x+10))
    12·1 answer
  • In statistics the mode of a set of values is the value that occurs most often. Write a program that determines how many pieces o
    10·1 answer
  • ________ is a process in which computer software that uses statistical analysis, database technology, and artificial intelligenc
    13·1 answer
  • Which is true about TCP and UDP? Choose two answers.
    8·1 answer
  • What is a third variable condition that could create the following correlation?
    10·2 answers
  • Which task can be completed with the Template Organizer?
    12·2 answers
  • LCD, EL and gas-plasma are types of flat-panel screens.<br> True<br> False
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!