Question: IN JAVA Rewrite the class below so it no longer specifically handles integer data. It should be able to handle any data type presently available
IN JAVA
Rewrite the class below so it no longer specifically handles integer data. It should be able to handle any data type presently available or any type created in the future.
NOTE: Using the "Object" class is not allowed.
HINT: Think about how an ArrayList can be declared using different data types.
class DataHandler { private int mData; int getData() { return mData } void setData(int _data) { mData = _data; } void logData() { Log.d(getClass().getName(), String.format("Data: %d", mData)); } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
