File tree 3 files changed +45
-0
lines changed
3 files changed +45
-0
lines changed Original file line number Diff line number Diff line change
1
+ package gitlec2 ;
2
+
3
+ public class Main {
4
+
5
+ public static void main (String [] args ) {
6
+ Profile suzuki = new SuzukiProfile ("naoto" );
7
+ suzuki .hello ();
8
+ }
9
+
10
+ }
Original file line number Diff line number Diff line change
1
+ package gitlec2 ;
2
+
3
+ public abstract class Profile {
4
+ private String name ;
5
+
6
+ public Profile (String name ) {
7
+ this .name = name ;
8
+ }
9
+
10
+ public String getName () {
11
+ return this .name ;
12
+ }
13
+
14
+ public void hello () {
15
+ System .out .println ("================================" );
16
+ System .out .println (getName () + "‚Ĺ‚·B\n " + profile ());
17
+ System .out .println ("================================" );
18
+
19
+ }
20
+
21
+ public abstract String profile ();
22
+ }
Original file line number Diff line number Diff line change
1
+ package gitlec2 ;
2
+
3
+ public class SuzukiProfile extends Profile {
4
+
5
+ public SuzukiProfile (String name ) {
6
+ super (name );
7
+ }
8
+
9
+ @ Override
10
+ public String profile () {
11
+ return "私の趣味は××××です。" ;
12
+ }
13
+ }
You can’t perform that action at this time.
0 commit comments