Question: Create a class ProblemSolution with following characteristics Two private member variables name & designation of string type. Parameterized constructor which takes 2 parameters to initialized
Create a class ProblemSolution with following characteristics
- Two private member variables name & designation of string type.
- Parameterized constructor which takes 2 parameters to initialized name & designation.
- Method solution with no input parameter and void return type. A method should print the member variable values in new lines.
Input John Snow
Warrior
where,
- First line represents a name.
- Second line represents a designation.
Output
John Snow Warrior
(Use Java to work on this question)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
