TUTORIAL QUESTIONS
Scenario 1 (Static method with void return type):
You need to create a utility method in a class called MessageUtility that
simply prints a greeting message to the console. The message should always
be "Welcome to our application!". Write the code for this static method,
ensuring it has a void return type.
Scenario 2 (Static method with a non-void return type):
You are writing a basic calculator. Create a static method within a class called
MathOperations that takes two integer numbers as input (you don't need to
define the parameters in the question, just describe the method). This
method should calculate the product of the two numbers and return the
result as an integer.
Scenario 3 (Instance method with void return type):
Imagine you have a class called Counter. Each object of this class should
have a method called incrementCount. This method should increase an
internal counter (you don't need to declare the instance variable in the
question) by one and then print the current value of the counter to the
console. Write the code for this instance method.
Scenario 4 (Instance method with a non-void return type):
You have a class called Circle that represents a circle. Each Circle object
might have a radius (you don't need to declare the instance variable). Create
an instance method called getArea within the Circle class. This method
should calculate the area of the circle (using a fixed value for PI within the
method) and return the calculated area as a double.