Skip to content

Commit 974707e

Browse files
Create MethodwithParams.java
1 parent 9afb2f5 commit 974707e

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

MethodwithParams.java

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
class Sports {
2+
public void like(String text) {
3+
System.out.println(text);
4+
}
5+
6+
public void rate(int point) {
7+
System.out.println("rating: " + point);
8+
}
9+
10+
public void score(String Type, double rank) {
11+
System.out.println( "Type " + Type +"Rank " + rank );
12+
}
13+
}
14+
15+
public class App {
16+
17+
public static void main(String[] args) {
18+
Sports sp = new Sports();
19+
20+
sp.like("My name is Dhoni");
21+
sp.rate(8);
22+
23+
sp.score("Batsman", 4);
24+
25+
String person = "Hello Dhoni";
26+
sp.like(person);
27+
28+
int value = 14;
29+
sp.rate(value);
30+
31+
}
32+
33+
}va

0 commit comments

Comments
 (0)