Skip to content

Commit 2fdddf1

Browse files
class作成の練習
1 parent 242257f commit 2fdddf1

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/h_you/demo/City.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package h_you.demo;
2+
3+
public class City {
4+
public String name;
5+
public Double latitude;
6+
public Double longitude;
7+
8+
public static void main(String[] args) {
9+
City ct = new City();
10+
ct.name = "beijing";
11+
ct.latitude = 39.903;
12+
ct.longitude = 116.401;
13+
System.out.println(ct.name);
14+
System.out.println("location: " + ct.latitude + ", " + ct.longitude);
15+
}
16+
}

0 commit comments

Comments
 (0)