Question: Write a class to model a Computer. A Computer has a constructor that takes the brand as a String. It also takes a double, gigahertz.
Write a class to model a Computer. A Computer has a constructor that takes the brand as a String. It also takes a double, gigahertz. Call the instance variables brand and ghz. Gigahertz is a measure of the clock speed of a computer.
Computer implements the the Comparable interface. Computers are ordered by gigahertz. If two Computers have the same speed (gigahertz), then the Computer with the brand that comes first in the lexicographical (alphabetical) order is the smaller. For Example, "Apple" comes before "Surface" alphabetically and so is the smaller.
Computer has methods getGhz() and getBrand().
A toString method is provided for you.
Provide Javadoc
Please use this to check: http://www.codecheck.it/files/1708020100d6qg24xncmeaspfv5ajeq3fxy
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
