본문 바로가기
반응형

java8

멤버필드와 멤버메서드 사용하기 (기초) [CODE] import java.io.*; public class Age { private BufferedReader in; private String name; private int age; public Age(){ in = new BufferedReader(new InputStreamReader(System.in)); name = ""; age = 0; } public void SetAge() throws IOException { System.out.print("나이 = "); age = Integer.parseInt( in.readLine() ); } public void SetName() throws IOException { System.out.print("이름 = "); name = in.re.. 2007. 11. 4.
간단한 상속소스 [CODE] class Book { String title; //타이틀 String genre; //장르 void PrintBook() { System.out.println("타이틀 : " + title); System.out.println("장 르 : " + genre); } } class Novel extends Book { String Write; //저자 void PrintWrite() { System.out.println("저자 : " + Write); } } class Magazine extends Book { int Day; void PrintDay() { System.out.println("발매일 : " + Day); } } class Custom extends Book { String p.. 2007. 11. 1.
간단한 버블정렬 Bubble Sort (버블소트) [CODE] public class Test001 { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub int data[] = {10, 5, 100, 35, 1, 95, 300, 150}; int len = data.length; int temp; for(int i=0; i 2007. 11. 1.
초간단 성적처리기 자바 성적처리기를 옛날에 C언어 하던 기억이 나서 만들었다 ㅡㅡ;; [CODE] import java.io.*; public class Hello { /** * @param args */ public static void main(String[] args) throws java.io.IOException { // TODO Auto-generated method stub System.out.println("---- 입력 ------"); BufferedReader in = new BufferedReader ( new InputStreamReader(System.in)); String Eng= ""; String Math = ""; String Han = ""; String name = ""; System... 2007. 11. 1.
반응형