Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please write a Java program which asks the user in terminal, examples are below) to provide a name of a Java class, and then creates

image text in transcribed

image text in transcribed

Please write a Java program which asks the user in terminal, examples are below) to provide a name of a Java class, and then creates an instance of that class with the default constructor (hint: see the examples in the lecture about The Reflection API) and performs some operations on that object as explained below, using exceptions to deal with all problematic situations so that the program never fails but asks for better input instead. 1. 1 pts After starting, the program asks for a name of Java class, and confirms that it will use that name in the next step, e.g. $ java Main Enter class name: Abc OK, instance of class 'Abc will be created. 2. 2 pts If no such class is available, the program asks for other name, e.g. $ java Main Enter class name: Abc OK, instance of class 'Abc' will be created. Sorry, I don't know this class. Enter class name: 3. 2 pts If the class is available, an instance of that class is created, and the object is printed (simply based on its toString() method), e.g. for a class which does not override toString() it may look similar to: Enter class name: A OK, instance of class 'A' will be created. The created object: A@251a69d7

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_2

Step: 3

blur-text-image_3

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 Processing

Authors: David Kroenke

11th Edition

0132302675, 9780132302678

More Books

Students also viewed these Databases questions

Question

What is topology? Explain with examples

Answered: 1 week ago

Question

In an Excel Pivot Table, how is a Fact/Measure Column repeated?

Answered: 1 week ago