Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions 1. Helloworld/src/Hello.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
public class Hello{
public static void main(String[] args){
System.out.println("Hello World");
}
}
5 changes: 0 additions & 5 deletions 1. Helloworld/src/HelloWorld.java

This file was deleted.

8 changes: 8 additions & 0 deletions 4. Methods/Method_Params.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
public class Method_Params {

// Method that accepts one int and one string as parameters
public void parameters(int number,String string){

}

}
21 changes: 21 additions & 0 deletions 4. Methods/Method_Pass_Args.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
public class Method_Pass_Args {

public static void main(String[] args) {

// Integers to add
int num1 = 2;
int num2 = 4;

// Calling the method add and returning the sum of the 2 integers
add(num1, num2);

}

// Method that adds 2 integers and returns the sum of those integers
public static int add(int num1, int num2) {

return num1 + num2;

}

}
19 changes: 19 additions & 0 deletions 4. Methods/SimpleMethod.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
public class SimpleMethod {
public static void main(String[] args){
method1();
method2();
method3();
}

public static void method1(){
System.out.println("Code executed from method1");
}

public static void method2(){
System.out.println("Code executed from method2");
}

public static void method3(){
System.out.println("Code executed from method3");
}
}