@@ -15,9 +15,9 @@ int getId(){
15
15
void input (){
16
16
Scanner sc = new Scanner (System .in );
17
17
System .out .print ("상품 설명>>" );
18
- explanation =sc .next ();
18
+ explanation =sc .nextLine ();
19
19
System .out .print ("생산자>>" );
20
- producer =sc .next ();
20
+ producer =sc .nextLine ();
21
21
System .out .print ("가격>>" );
22
22
price =sc .nextInt ();
23
23
}
@@ -37,12 +37,12 @@ class Book extends Product{
37
37
void input (){
38
38
super .input ();
39
39
Scanner sc = new Scanner (System .in );
40
- System .out .print ("ISBN 번호>>" );
41
- ISBNnum =sc .nextInt ();
42
40
System .out .print ("책 제목>>" );
43
- book_title =sc .next ();
41
+ book_title =sc .nextLine ();
44
42
System .out .print ("저자>>" );
45
- writer =sc .next ();
43
+ writer =sc .nextLine ();
44
+ System .out .print ("ISBN 번호>>" );
45
+ ISBNnum =sc .nextInt ();
46
46
}
47
47
void print (){
48
48
super .print ();
@@ -60,9 +60,9 @@ void input(){
60
60
super .input ();
61
61
Scanner sc = new Scanner (System .in );
62
62
System .out .print ("앨범 제목>>" );
63
- album_title =sc .next ();
63
+ album_title =sc .nextLine ();
64
64
System .out .print ("가수>>" );
65
- singer_name =sc .next ();
65
+ singer_name =sc .nextLine ();
66
66
}
67
67
void print (){
68
68
super .print ();
@@ -91,7 +91,7 @@ public class ProductInfo {
91
91
92
92
static void productAdd (){
93
93
Scanner sc = new Scanner (System .in );
94
- System .out .println ("상품 종류 책(1), 음악CD(2), 회화책(3)>>" );
94
+ System .out .printf ("상품 종류 책(1), 음악CD(2), 회화책(3)>>" );
95
95
Product p =null ;
96
96
int num =sc .nextInt ();
97
97
0 commit comments