add examples in java 8 (#12)
* code for chapters 3-9 in Java * code for chapters 1 in Java * code for chapter 2 in Java * missing CheckVoter for chapter 5 in Java * add missing sample output for SetCovering as a comment
This commit is contained in:
committed by
Aditya Bhargava
parent
12265a8c61
commit
4631b7a156
21
03_recursion/java/02_greet/src/Greet.java
Normal file
21
03_recursion/java/02_greet/src/Greet.java
Normal file
@@ -0,0 +1,21 @@
|
||||
public class Greet {
|
||||
|
||||
private static void greet2(String name) {
|
||||
System.out.println("how are you, " + name + "?");
|
||||
}
|
||||
|
||||
private static void bye() {
|
||||
System.out.println("ok bye!");
|
||||
}
|
||||
|
||||
private static void greet(String name) {
|
||||
System.out.println("hello, " + name + "!");
|
||||
greet2(name);
|
||||
System.out.println("getting ready to say bye...");
|
||||
bye();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
greet("adit");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user