일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Graphic
- 국제화
- 메서드
- 기본
- paint
- Eclips
- 생성자
- Java
- 메소드
- JSP
- 어노테이션
- 배열
- AWT
- JavaScript
- struts2
- Spring
- layout
- Menu
- 전화걸기
- Android
- mybatis
- 안드로이드
- HTML
- OGNL
- 에러페이지
- 예외처리
- 클래스
- 이클립스
- 오버로딩
- oracle
- Today
- Total
목록Call by reference (2)
note
class MyDate{//참조 호출 call by reference int year=2006; int month=4; int day=1; } class RefMethod{ void changeDate(MyDate t){ t.year=2007; t.month=7; t.day=19; } } public class MethodTest09 { public static void main(String[] args){ RefMethod rm = new RefMethod(); MyDate d=new MyDate(); //각 각 클래스 메모리에 올리기 System.out.println("함수 호출전 d-> "+d.year+"/" +d.month+ "/" +d.day); rm.changeDate(d); //주소를 MyD..
public class ReferenceParameter {// 참조 호출 Call by reference // 멤버 메소드 // 메소드 호출방식 : 주소를 전달해서 메소드를 호출 // call by reference public void increase(int[] n) { for (int i = 0; i < n.length; i++) n[i]++; } // 메인 메소드 public static void main(String[] args) { // 배열 생성 int[] ref1 = { 100, 800, 1000 }; System.out.println("ref1[0] : " + ref1[0]); System.out.println("ref1[1] : " + ref1[1]); System.out.println..