일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 가변인자
- 추상클래스
- Full text
- 자바
- 형변환
- while
- 전자정부
- angular2
- Random
- 다운캐스팅
- full text indexing
- 스프링
- jquery
- 자바 야구게임
- 다형성
- 상속예제
- Login with OAuth Authentication
- 전체텍스트
- 페이징
- 야구게임
- 전체
- Validations
- 단축키
- 상속
- IBatis procedure
- 로또
- 이클립스
- 업캐스팅
- 25가지 효율적인 sql작성법
Archives
- Today
- Total
nalaolla
Method 예제 1 본문
728x90
반응형
- package test.com;
- public class Test01DPO {
- Test01VO vo;
- public Test01DPO() {
- }
- public Test01DPO(Test01VO vo) {
- this.vo = vo;
- }
- public void test() {
- System.out.println(vo.getModelName());
- System.out.println(vo.getProductNum());
- System.out.println(vo.getProductName());
- System.out.println(vo.getCreateDate());
- }
- public void test(Test01VO vo) {
- //Test01VO vo = new Test01VO();
- System.out.println(vo.getModelName());
- System.out.println(vo.getProductNum());
- System.out.println(vo.getProductName());
- System.out.println(vo.getCreateDate());
- }
- }
- package test.com;
- import java.util.Date;
- public class Test01VO {
- private int productNum; //제품번호
- private String productName; //제품명
- private String modelName; //모델명
- private Date createDate; //제조일
- public int getProductNum() {
- return productNum;
- }
- public void setProductNum(int productNum) {
- this.productNum = productNum;
- }
- public String getProductName() {
- return productName;
- }
- public void setProductName(String productName) {
- this.productName = productName;
- }
- public String getModelName() {
- return modelName;
- }
- public void setModelName(String modelName) {
- this.modelName = modelName;
- }
- public Date getCreateDate() {
- return createDate;
- }
- public void setCreateDate(Date createDate) {
- this.createDate = createDate;
- }
- }
- package test.com;
- import java.util.Date;
- public class Test01Main {
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- System.out.println("product...");
- Test01VO vo = new Test01VO();
- System.out.println(vo);
- vo.setProductNum(1009);
- vo.setProductName("하드디스크");
- vo.setModelName("HD1414");
- vo.setCreateDate(new Date());
- System.out.println("==========================");
- Test01DPO dpo = new Test01DPO(vo);
- dpo.test();
- Test01DPO dpo2 = new Test01DPO();
- dpo2.test(vo);
- }
- }
728x90
반응형
'JAVA > 10. Method3' 카테고리의 다른 글
Method 예제 4 (Board) (0) | 2016.06.29 |
---|---|
Method 예제 3 (Member) (0) | 2016.06.29 |
Method 예제 2 (Score) (0) | 2016.06.29 |