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
Which of the following is not a primary environment in Autodesk Inventor? A. Parts B. Assemblies C. Animations D. Presentations
UNO [17]

I want to say it's C. Animations.

I hope this helps!

7 0
3 years ago
You have a large company, and it is important to your business that your employees' work is backed up regularly. Which network w
valkas [14]
Client server network as it has a powerful server which provides all the networks required on the network. Files are usually backed up regularly.

3 0
4 years ago
One disadvantage of online information sharing is that:
zubka84 [21]

Answer:

its b i just took the test

Explanation:

3 0
3 years ago
Read 2 more answers
How do ACLs work on a router?
serg [7]

Answer:

An ACL is a list of permit or deny rules detailing what can or can't enter or leave the interface of a router. Every packet that attempts to enter or leave a router must be tested against each rule in the ACL until a match is found. If no match is found, then it will be denied.

Explanation:

PLEASE MARK ME AS BRAINLIEST

6 0
3 years ago
Why isn't 802.1X a good choice for home based wireless networks
Sholpan [36]
It can possibly cause an issue with the authenticator's end. Its capacity has a limited memory capacity and has the minimal processing power. Most of the process will be at the supplicant and authentication servers. However, the 802.1X has a better security compared to the WEP.
6 0
3 years ago
Other questions:
  • Consider a multiprocessor CPU scheduling policy. There are 2 options: 1) a singlecommon ready queue of jobs; when a CPU becomes
    8·1 answer
  • Write HTML code for inserting an image "cricket.jpeg" in size 500 width and 400 height.
    12·1 answer
  • 2. Which of the following statements describes a need or problem that can be solved using the technology design process.
    14·1 answer
  • an early type of GUI is created, which includes windows, pop-ups, icons, and menus. What year did this happen? Please help!!! qu
    12·1 answer
  • Any device that uses light to read and write information.
    9·2 answers
  • The ability to use various design software such as Adobe Photoshop, InDesign, and Illustrator would be MOST beneficial to which
    6·1 answer
  • Who made the game Monopoly???
    10·2 answers
  • Answer pls pls pls pls ​
    13·1 answer
  • Implement one array of the English alphabet (26 characters). a) Create a function, getLetters() to cast and generate the array.
    5·1 answer
  • A(n) ____________ calculator is a device that assists in the process of numeric calculations but requires the human operator to
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!