일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- sql랭킹
- xmldom
- VarType
- array
- 정규식
- sql업데이트
- ERD
- inner join
- injection
- javascript 한글입력체크
- tempDB
- JavaScript
- update
- instr
- wap
- 이미지세로길이
- 한글입력체크
- 이미지가로길이
- VARIABLE
- FileSystemObject
- MSSQL보안
- WML
- asp함수
- XML
- 인젝션
- jdbc driver
- SPLIT
- join
- sql순위
- 자바기초
- Today
- Total
목록분류 전체보기 (377)
3초기억력
// 오버라이드 : ~위에 덮어쓰다. ~ 우선되다. // - 오버라이딩 //- 부모클래스로부터 상속받은 메서드의 내용을 자식클래스에 맞게 변경하는 것(재정의) // 오버라이딩 조건 //- 선언부(메스드명, 매개변수, 리턴타입) 동일 //- 접금제어자를 좁은 범위로 변경할 수 없다. // 오버로딩 : 기존에 없는 메서드를 정의 //2차원 포인트 //3차원 포인트 class Point{ int x; int y; String getLocation() { return "x>" + x + ", y>"+ y; } } class Point3D extends Point{ int z; String getLocation(String i1) {//오버로딩 return i1; } int getLocation(int i, in..
//유닛 배열 생성 //변수: hp, mp | method : attack //하늘 - 비행기, 드래곤 각 10개 //땅 - 탱크, 사람 각 10개 class Unit{ int hp; int mp; void attack() { System.out.println("기본 공격 ~~~~~~~~~~~~~~~~~"); } } //하늘 class Sky extends Unit{ } //땅 class Ground extends Unit{ } //비행기 class Airplane extends Sky{ @Override void attack() { System.out.println("미사일 공격!!"); } } //드래곤 class Dragon extends Sky{ @Override void attack() { Sy..
//객체 배열 - 클래스들의 배열 // - 기본타입의 배열이 아니라 객체가 원소인 배열 //즉, 객체에 대한 주소를 갖는 배열 //학생 100명을 저장하는 배열 //이름, 나이, 학과, 학번 class Student{ String name; int age; String classname; String classno; void study() { System.out.println("공부한다."); } } public class ObjectArray { public static void main(String[] args) { int[] list_number = new int[100]; //정수 100개를 저장하는 배열 Student[] list = new Student[100]; //학생클래스의 100개의 주..
//기본 : 모델명, 번호, 벨소리 //생성자 생성 //기능 : set number, get model, get chord // 추가 : 사이즈 // 추가 : pixel package Inheritance; class Cellphone{ String model;//모델명 String number;//폰번호 int chord;//벨소리 //생성자 생성 public Cellphone(String model, String number, int chord) { this.model = model; this.number = number; this.chord = chord; } void setNumber(String number) {//번호 재저장 this.number = number; } String getMode..
//계좌정보 - 계좌번호, 이름, 잔액 //기능-입금, 출금(잔액이 모자랄경우 경고) //카드번호 추가 class. pay 시 카드번호 or 잔액 모자랄 경우 경고 package Inheritance; class Account{ String accountNo;//계좌번호 String name;//이름 int balance;//잔액 void deposit(int a) {//입금 this.balance += a; } int withdraw(int b) {//출금 if (this.balance < b) { return 0; } else { this.balance -= b; return this.balance; //return this.balance - b;//한줄로도 가능 } } @Override public..
//평균 클래스를 상속을 받아서 평균과 총점을 구하는 하위 클래스를 생성 package Inheritance; class Avg{ double avg; Avg(){}//없으면 오류 Avg(double avg){ this.avg = avg; } void average(int sum) { avg = (double)sum / 2; //avg = sum / 2.0;실수로 변환하기 위한. System.out.println("평균 : " + avg); } } class Total extends Avg{ int total; int math; int eng; Total(int math, int eng) { this.math = math; this.eng = eng; this.total = this.math + this..
// 상속 : 재산을 물려받는 행위 // 기존 클래스에 기능을 추가하거나, 재정의 : 새로운 클래스를 정의하는 것. // 객체(인스턴스)들은 Object 클래스를 자동적으로 상속 받는다. // 기본클래스 -> 파생클래스 // 부모클래스 -> 자식클래스 // 상위클래스 -> 하위클래스 // 자식클래스의 멤버갯수는 부모클래스보다 같거나 많을 수 있다. // 상속의 범위 : 멤버변수, 메서드 //생성자 제외! // 명령어 클래스명 extends 기본클래스명 // 자바는 다중 상속이 안된다 -> 해결 interface package Inheritance; class Person{ int age; String name; void eat(String a) { System.out.println(a + "를 먹었습니다..
//인터넷가입정보 클래스명 //필수-이름,아이디,pw // 전화번호, 주소 //패스워드 변경 class SubscriberInfo{ String name; String id; String pw; String phoneNum; String address; //이름, 아이디, pw public SubscriberInfo(String name, String id, String pw) { this.name = name; this.id = id; this.pw = pw; } //전부 public SubscriberInfo(String name, String id, String pw, String phoneNum, String address) { super(); this.name = name; this.id = i..
// 좌표저장하는 클래스 // 생성자를 이용한 인스턴스 복사 // 입력값으로 클래스참조변수 class D{ int xpos, ypos; // 기본생성자 X D(int x, int y){ this.xpos = x; this.ypos = y; } D(D d1){ this.xpos = d1.xpos; this.ypos = d1.ypos; } @Override public String toString() { return "D [xpos=" + xpos + ", ypos=" + ypos + "]"; } } public class ConstructorEx2 { public static void main(String[] args) { D a1 = new D(100, 100); System.out.println(a1)..
// 회원가입 Join // * 꼭 기입 이름,전화번호,주소 // 생년월일, 직장주소, 직장전화번호 class Join{ String name; String phone; String address; String birth; String work_address; String work_phone; //우클릭 > source > Generate Constructor Using Fields public Join(String name, String phone, String address, String birth, String work_address, String work_phone) { this.name = name; this.phone = phone; this.address = address; this.birt..