Question: JAVA: Question 2.0 (10 points) Using the 'this' keyword explicitly. As we discuss in class, the keyword 'this' is used as the reference of the
JAVA:


Question 2.0 (10 points) Using the 'this' keyword explicitly. As we discuss in class, the keyword 'this' is used as the reference of the current object. You are given the following DropC class that has three members (a private int i and two methods: DropC increment( ) and void print()). class Dropc { private int i = 0; Dropc increment() { i++; return this; void print() { System.out.println("number of Dropc = " + i); Write a client program that updates and displays the number of times that the increment( ) is called in the Dropc object. The number needs to be ( >= 3) and less than 10. If the random count is
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
