I don't know how to start this program and I don't know what I am doing. The purpose of this assignment is to practice writing the three different types of methods. These three methods are very simple in their purpose.
Here are the three methods, their names, and their purpose:
noParametersNoR eturn - This method will simply display the words "I am here"
twoParametersNo Return - This method will have two parameters which are both integers. The method will multiply the two parameters and display the result.
twoParametersOn eReturn - This method will have two parameters which are both integers. It will add the two integers together and return the result of that addition.
In your main method you will call each method. Be sure that you display the results of your call to the third method.
This is what I have so far.
I am new to this stuff and I really need help.
Here are the three methods, their names, and their purpose:
noParametersNoR eturn - This method will simply display the words "I am here"
twoParametersNo Return - This method will have two parameters which are both integers. The method will multiply the two parameters and display the result.
twoParametersOn eReturn - This method will have two parameters which are both integers. It will add the two integers together and return the result of that addition.
In your main method you will call each method. Be sure that you display the results of your call to the third method.
This is what I have so far.
Code:
/** This program is a practice to write three different types of methods.
*/
public class MethodTypes
{
public static void main(String[] args)
{
public static void noParametersNoReturn;
{
System.out.println("I am here");
}
/** The twoParametersNoReturn will have two parameters which are both intergers. It will multiply the two parameters and
display the results.
*/
public static void twoParametersNoReturn;
{
Comment