Question: Do in java Code provided Problem Statement Two classes - Camera and Digital Camera are provided to you. Though the object of DigitalCamera class is



Problem Statement Two classes - Camera and Digital Camera are provided to you. Though the object of DigitalCamera class is being created with values as 'Canon' and 100 in the main method of Tester class, the code given below generates the following output Nikon 0.0 16 r Make the necessary changes in the code such that the member variables are initialized with proper values and the output is generated as follows: Output Canon 100.0 16 Download the Java project from here to solve this exercise in Eclipse. 1-class Camera { 2 private String brand; 3 private double cost; 4 5 public Camera() { 6 this.brand = "Nikon"; 7 } 8 public String getBrand() { 10 return brand; } public void setBrand(String brand) { this.brand = brand, 3 public double getCost() { return cost: I } 5 3. class DigitalCamera extends Camera { private int memory; public DigitalCamera(String brand, double cost) { 7 this memory 16; 18 201 public int getMemory { return memory public void setMemory (ant memory) this.memony = memory 38 - Class Tester 39 public static void main(Stringt) args) 40 DigitalCamera camera ne Digital Camera Canon, 100); System.out.println(icamera.getBrandscamera, eetcosto camera,getttemory()); 42 43
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
