Write a user-defined class called person this class should


1. What is the difference between a Java compiler and a Java interpreter?

2. Write a user-defined class called Person. This class should have private instance variables defined as:

private int age;private String firstName;private String lastName;
In addition, the class should have a constructor defined as:

public Person(String _firstName, String _lastName, int _age)
that assigns values to the private instance variables. The class should also include the following public methods:

public void printName() - prints the person's namepublic void printAge() - prints the person's agepublic void printAgeGroup() - prints the person's age group (i.e. 20's. 30's, etc.)
Only include this last method if it is necessary to include logic in the assignment.

Write a second class with the method, "public static void main(String args[])". At least two objects based on the Person class should be created in the "main" method. The name, age, and age group should be displayed for each object.

3. Pick a problematic situation that you think a Java program can solve or make easier. Explain the problem and then write the pseudo code for it.

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Write a user-defined class called person this class should
Reference No:- TGS01250933

Now Priced at $20 (50% Discount)

Recommended (91%)

Rated (4.3/5)