Answered step by step
Verified Expert Solution
Question
1 Approved Answer
2 . 1 . Create a method whatDidYouPassMe ( ) . This method: accepts a single Object as a parameter The method header could be:
Create a method whatDidYouPassMe This method:
accepts a single Object as a parameter
The method header could be:
public static void whatDidYouPassMeObject X
uses instanceof to determine what type of object has been passed
outputs to the console based on the type of object
If one of the Java wrapper classes is passed,
output the name of the wrapper class to the console.
The wrapper classes are:
Boolean
Byte
Character
Integer
Float
Double
Long
Short
All of these classes are defined by Java already.
You do not have to create these classes.
If some other kind of object is passed,
output I dont know what kind of object that was. to the console.
Create a main program that calls whatDidYouPassMe with several kinds of objects:
Each of the wrapper classes listed above
Exception
whatDidYouPassMe should output I dont know what kind of object that is
String
whatDidYouPassMe should output I dont know what kind of object that is
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started