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
sweet [91]
2 years ago
8

Given the following class, Book, Write code for the following:

Computers and Technology
1 answer:
Yuri [45]2 years ago
7 0

Using the knowledge in computational language in JAVA it is possible to write a code that can organize the books in price and author classes.

<h3>Writing the code in JAVA we have:</h3>

<em>class Book{</em>

<em>    private int price;</em>

<em>    private String author;</em>

<em>    public Book(int p){</em>

<em>        price=p;</em>

<em>    }</em>

<em>    public Book(Book b){</em>

<em>        price=b.price;</em>

<em>        author=b.author;</em>

<em>    }</em>

<em>    public int getPrice(){</em>

<em>        return price;</em>

<em>    }</em>

<em>    public void setAuthor(String a){</em>

<em>        author=a;</em>

<em>    }</em>

<em>    public String toString(){</em>

<em>        return author+" "+Integer.toString(price);</em>

<em>    }</em>

<em>}</em>

<em>public class Main</em>

<em>{</em>

<em> public static void main(String[] args) {</em>

<em>     Book b=new Book(450);</em>

<em>     b.setAuthor("Jack");</em>

<em>     Book b1=new Book(b);</em>

<em>     System.out.println(b1.toString());</em>

<em> }</em>

<em>}</em>

See more about JAVA at brainly.com/question/18502436

#SPJ1

You might be interested in
Type the correct answer in each box. Spell all words correctly.
andrew11 [14]

Answer:

1. Tablet

2. Flat

Explanation:

5 0
3 years ago
How to calculate 100MB at 56 Kbps to transfer time?
Gelneren [198K]
1MB=1000 kb 

\frac{100*1000Kb}{56Kb/s} ≈ 1748,71 seconds 


ransform in kilobyte and share knowing transfer time :)
3 0
3 years ago
You can choose which rules you want excel to use by enabling and disabling them in the ____ area in the excel options dialog box
vfiekz [6]
It is in the conditional formatting area that such changes are made.
4 0
3 years ago
What is the system of computers, routers, wires, cables,etc. that allow computers to communicate called?
Anika [276]
Internet maybe?
Not 100% sure though
5 0
3 years ago
Which statement is true about the storage media?
Ksivusya [100]

The statement which is true about storage media is "Cache memory is much faster than Magnetic disk storage. But it is much expensive than magnetic disks."

The cache memory is faster than both SDDs and HDDs. In mathematical terms, it is 4 time faster than SSDs and 80 times faster than HDDs. Moreover, it is more expensive then the SSDs and HDDs storage. Practically speaking, it is not good to have as much in-memory storage as persistent block storage on SSDs or HDDs.

The remaining statements are incorrect such as "Cost per bit in SSDs is lower than that of a Magnetic tapes". While truth be told the SSD cost more than the Magnetic Tapes.

Magnetic disk storage is faster than SSD storage and hence it is a good candidate for a database that needs faster access time. The statement is also incorrect as SSD are much faster than Magnetic Disk Storage.

Learn more in: brainly.com/question/25026748

8 0
2 years ago
Other questions:
  • The main storage device inside a computer where programs and files are saved is called the
    5·1 answer
  • Which career professional and creates large data base and makes the data base with other systems
    13·1 answer
  • Read each scenario, and then select the best wireless device for the worker’s needs. A trucker is constantly on the road. He fre
    8·2 answers
  • what is the definition of web search(ing)? when I look it up it keeps trying to give me definitions for search engines but that'
    10·2 answers
  • ____ assigns a risk rating or score to each information asset. Although this number does not mean anything in absolute terms, it
    8·1 answer
  • Which of the following is true regarding a class and interface types? Group of answer choices You can convert from a class type
    9·1 answer
  • Where is the best place to self learn c++ or c# that is free?
    6·2 answers
  • PLEASE HELP ILL GIVE BRAINLIEST IMMEDIATLEY TO THE CORRECT ;-;
    10·1 answer
  • Select the correct answer from each drop-down menu.
    5·2 answers
  • Who addicted to fnaf
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!