Question: Create a class Android whose objects have unique data. The class has the following attributes: tag - a static integer that begins at 1 and
Create a class Android whose objects have unique data. The class has the following attributes:
tag a static integer that begins at and changes each time an instance is created
namea string that is unique for each instance of this class
Android has the following methods:
Androida default constructor that sets the name to "Bob" concatenated with the value of tag.
After setting the name, this constructor changes the value of tag by calling the private method
changeTag.
getName returns the name portion of the invoking object.
c The Independent Institute of Education Pty Ltd
Page of
dependent Institute of Education Pty Ltd
;
isPrimen a private static method that returns true if is primethat is if it is not divisible by
any number from to
changeTaga private static method that replaces tag with the next prime number larger than the
current value of tag.
Create a program that tests the class Android described in this Question
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
