Question: Exercise 1 . 2 : Next Class A class contains variables and methods, for the class Enemy do just 3 things: Declare a private String

Exercise 1.2: Next Class
A class contains variables and methods, for the class Enemy do just 3 things:
Declare a private String variable named type
Write a public method named gettype that returns the value of the global variable
Write a public method named settype that has one parameter, and changes the value of the global variable
You do not have to declare a Enemy variable, create an object or call the methods, I will do that.
Exercise 1 . 2 : Next Class A class contains

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 Programming Questions!