게시판 즐겨찾기
편집
드래그 앤 드롭으로
즐겨찾기 아이콘 위치 수정이 가능합니다.
자바 초보 2시간째 삽질중
게시물ID : programmer_5349짧은주소 복사하기
작성자 : 베르캄프
추천 : 0
조회수 : 935회
댓글수 : 12개
등록시간 : 2014/09/09 18:53:02
22.jpg

product.java 파일은 컴파일 잘되는데
productinfo.java를 컴파일하는데 위와 같이 에러가 납니다 ㅠㅠ 인터넷뒤져서 utf-8로 저장하라고 했는데, 그때는 unmappable character ms949라는 에러가 뜨구요 ㅠㅠ
이클립스에서 에러없이 수행이 되는데 왜 cmd창 컴파일할때는 에러가 나는지 당최 알수가 없습니다 ㅠㅠ


product.java 파일-----------------
package sampleproject;

public class Product {

String productSolmyung;
String sengSanja;
int price;
}


class book extends Product{
String ISBN;
String BookWriter;
String BookTitle;
}



class CompactDisc extends Product{
String AlbumTitle;
String Singer;
}



class ConversationBook extends book{
String Language;
}


productinfo.java 파일------------------------
package sampleproject;

import sampleproject.Product;
import java.util.Scanner;

public class ProductInfo {
public static int ID = 0;
public static void main(String[] args){
Scanner in = new Scanner(System.in);
System.out.print("상품추가(1), 모든 상품조회(2), 끝내기(3)>> ");
int number = Integer.parseInt(in.nextLine());
if(number == 1){
System.out.print("상품종류 책(1), 음악시디(2), 회화책(3)>> ");
number = Integer.parseInt(in.nextLine());
if(number == 1){
book tybook = new book();
System.out.print("제품설명>> ");
tybook.productSolmyung = in.nextLine();
System.out.print("생산자>>> ");
tybook.sengSanja = in.nextLine();
System.out.print("가격>> ");
tybook.price = Integer.parseInt(in.nextLine());
System.out.print("작가>> ");
tybook.BookWriter = in.nextLine();
System.out.print("책 제목>> ");
tybook.BookTitle = in.nextLine();
System.out.print("ISBN>> ");
tybook.ISBN = in.next();
System.out.println(tybook.productSolmyung);
System.out.println(tybook.sengSanja);
System.out.println(tybook.price);
System.out.println(tybook.BookTitle);
System.out.println(tybook.ISBN);
}
if(number == 2){
CompactDisc disc = new CompactDisc();
System.out.print("제품설명>> ");
disc.productSolmyung=in.nextLine();
System.out.print("생산자>>> ");
disc.sengSanja = in.nextLine();
System.out.print("가격>> ");
disc.price = Integer.parseInt(in.nextLine());
System.out.print("앨범제목>> ");
disc.AlbumTitle = in.nextLine();
System.out.print("가수>> ");
disc.Singer = in.nextLine();
}
if(number == 3){
ConversationBook csbook = new ConversationBook();
System.out.print("제품설명>> ");
csbook.productSolmyung = in.nextLine();
System.out.print("생산자>> ");
csbook.sengSanja = in.nextLine();
System.out.print("가격>> ");
csbook.price = Integer.parseInt(in.nextLine());
System.out.print("작가>> ");
csbook.BookWriter = in.nextLine();
System.out.print("책 제목>> ");
csbook.BookTitle = in.nextLine();
System.out.print("언어>> ");
csbook.Language = in.nextLine();
System.out.print("ISBN>> ");
csbook.ISBN = in.next();  
        }
      }
}
}





전체 추천리스트 보기
새로운 댓글이 없습니다.
새로운 댓글 확인하기
글쓰기
◀뒤로가기
PC버전
맨위로▲
공지 운영 자료창고 청소년보호