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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!