Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Do in java image text in transcribed
Code provided
image text in transcribed
image text in transcribed
image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

PC Magazine Guide To Client Server Databases

Authors: Joe Salemi

1st Edition

156276070X, 978-1562760700

More Books

Students also viewed these Databases questions

Question

Are robots going to displace all workers? Explain your answer.

Answered: 1 week ago