Question: Consider the following class public class Laptop { private double price; private String model; private int quantity; private int year; public Laptop () (price-0.0; model=X

 Consider the following class public class Laptop { private double price;

Consider the following class public class Laptop { private double price; private String model; private int quantity; private int year; public Laptop () (price-0.0; model="X" ; quantity 0; year=2000;} public void setLaptop (double p, String m, int q, int y) {price-p: model-m; quantity-q; year y;} public double getPrice () {return price; } public String getmodel () {return model:) public int getquantity ( ) (return quantity:) public int getyear() {return year:) ) Assuming that an array of type Laptop named list is created and populated with data in the main method. Write a static method named find Laptop that takes as parameter the array list and an integery. The method should output the model of the most expensive laptop (having he highest price of the year equal to the parametery. The method prototype is public static void find Laptop (Laptop I) list, inty)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!