-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFunctionTypes.java
More file actions
20 lines (17 loc) · 817 Bytes
/
Copy pathFunctionTypes.java
File metadata and controls
20 lines (17 loc) · 817 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
public class FunctionTypes {
public static void staticFunction() {
System.out.println("I am a static function\nAnd I dont need any object to create of my class in order to access it via another static function/method.");
}
public static void staticAddFunction(int a, int b) {
System.out.println("Sum of numbers passed to this static add function is: " + (a + b));
}
public void nonStaticFunction() {
System.out.println("I am a static function\nAnd I need an object to create of my class in order to access it via another static function/method.");
}
public static void main(String[] args) {
staticFunction();
staticAddFunction(17, 10);
FunctionTypes functionTypes = new FunctionTypes();
functionTypes.nonStaticFunction();
}
}