Skip to content

Commit aebad02

Browse files
committed
ADD Sub Methods - vishwa
1 parent edc6dd0 commit aebad02

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed
392 Bytes
Binary file not shown.

VishwaCoreJava/src/com/vishwa/corejava/Methods.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,16 @@
22

33
public class Methods {
44
public static void main(String[] args) {
5+
Methods.sub(99, 55);
6+
Methods obj = new Methods();
7+
obj.add(12, 56);
8+
}
9+
10+
public void add(int x, int y) {
11+
System.out.println(x + y);
12+
}
513

14+
public static void sub(int x, int y) {
15+
System.out.println(x - y);
616
}
717
}
8-

0 commit comments

Comments
 (0)