-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReviewProgram.java
More file actions
29 lines (28 loc) · 927 Bytes
/
ReviewProgram.java
File metadata and controls
29 lines (28 loc) · 927 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/**
* Class name: ReviewProgram.java
* author: Joseph Grados
* collaborator: Dr. Hyesung Park
* Date: 8/11/2022
*verison 1.1
*description: This program will generate some examples from the ITEC 2140 course.
*
*
*/
public class ReviewProgram{
public static void main(String [] args){
ReviewProgram rp = new ReviewProgram(); // create ReviewProgram type object to call instance methods.
System.out.println("Enter two number");
Scanner input = new Scanner(System.in);
int number1 = input.nextInt();
int number2 = input.nextInt();
int result = rp.add(number1, number2);
System.out.println("Result of two numbers " + number1 + " and " + number2 + " is " + resultStatic);
}
public int add(int firstNum, int secondNum)// instance method/non-static method
{
return firstNum + secondNum;
}
public static int addStatic(int firstNum, int secondNum){
return firstNum + secondNum;
}
}