Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2 . 1 . Create a method whatDidYouPassMe ( ) . This method: accepts a single Object as a parameter The method header could be:

2.1. Create a method whatDidYouPassMe(). This method:
accepts a single Object as a parameter
The method header could be:
public static void whatDidYouPassMe(Object 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.
2.2. 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Reliability Engineering Designing And Operating Resilient Database Systems

Authors: Laine Campbell, Charity Majors

1st Edition

978-1491925942

More Books

Students also viewed these Databases questions

Question

what lactalis should learn from famine's experience in India

Answered: 1 week ago

Question

=+4. What do you think?

Answered: 1 week ago