Difference between a java compiler and a java interpreter


Discuss the below:

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

Q2. 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.

Q3. 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: Difference between a java compiler and a java interpreter
Reference No:- TGS01935478

Now Priced at $25 (50% Discount)

Recommended (96%)

Rated (4.8/5)