Class method and instance method


Question1. Explain what is meant by a ‘constructor’ in Java. Use an easy case in point to illustrate your answer.

Question2. Make a distinction between a class method and an instance method. Demonstrate with an example.

Question3. Illustrate the different ways you can call a method in Java with proper examples.

Question4. Write a program which will print the square of numbers from 1 to 10 on a message dialog. Here you must have a technique called square in your program.

Question5. Write a program which will test whether the number entered by a user is either even or odd. You may use an input dialog from JOptionPane to prompt the user to enter the number.

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: Class method and instance method
Reference No:- TGS05558

Expected delivery within 24 Hours