Skip to content

Commit bc404ff

Browse files
committed
added method demo
1 parent ce03ee9 commit bc404ff

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

ch04/HelloMethod.java

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import java.sql.SQLOutput;
2+
3+
public class HelloMethod
4+
{
5+
public static void main(String[] args)
6+
{
7+
String firstName = "Fred ";
8+
String secondName = "Wilma ";
9+
String thirdName = "Pebbles";
10+
String lastName = "Flintstone";
11+
printHelloWorld(firstName, lastName);
12+
printHelloWorld(secondName, lastName);
13+
printHelloWorld(thirdName, lastName);
14+
printOhNo();
15+
}
16+
17+
public static void printHelloWorld(String fname, String lName)
18+
{
19+
System.out.println("Hello World " + fname + lName);
20+
}
21+
22+
public static void printOhNo()
23+
{
24+
System.out.println("Oh No !!!!!!!!!!");
25+
26+
}
27+
28+
public static void printNumberNoSign(int number)
29+
{
30+
31+
}
32+
33+
34+
}
35+

0 commit comments

Comments
 (0)