728x90
반응형

Java 44

[자바] 노트패드++ 배열

배열은 동일한 데이터형의 자료를 연속 기억공간에 저장하고 인덱스를 사용하여 접근할 수 있는 데이터 형이다. public class Ex3 { public static void main(String args[]) { int stuNum[] = {1,2,3}; String stuName[]; stuName = new String[3]; double stuScore[] = new double[3]; stuName[0] = new String("정진철"); stuName[1] = new String("강성우"); stuName[2] = new String("김태수"); stuScore[0] = 100.0; stuScore[1] = 95.5; stuScore[2] = 97.0; System.out.println(..

[자바] 노트패드++ Wrapper 클래스

Wrapper 클래스 : 문자열을 기본 데이터 형으로 변환하기 위한 클래스 public class ImportExam { public static void main(String args[]) { String strNum = "2005"; String strBool = "true"; int intNum = Integer.parseInt(strNum); float floatNum = Float.parseFloat(strNum); Boolean boolObj = Boolean.valueOf(strBool); boolean bool = boolObj.booleanValue(); System.out.println("Integer.parseInt(strNum) -> " + intNum); System.out.pri..

728x90
반응형