My footsteps

public class Continu { public static void main(String[] args) { //int [] score; //1.int형식의 배열 scroe를 선언(참조변수) //score = new int[5]; //2.배열 생성(몇개 넣을건지) int[] score = new int[5]; //배열의 선언과 생성을 한번에 score[3] = 5; //어느배열에 어떤값을 넣을건지 score[2] = 100; System.out.println("score[3] = "+score[3]); System.out.println("score[2] = "+score[2]); int num = score[3]; //변수 num에 score배열값 넣고 System.out.println(num); ..

public class Restart { public static void main(String[] args) { int i = 5; while(i--!=0) { //= i에서 1씩 뺀값이 0이 아니다 > 1-1은 0이 나올텐데,0!=0은 거짓이므로 while문이 종료된다 System.out.println(i+"아자아자"); } } } public class Restart { public static void main(String[] args) { int sum = 0; int i = 0; while(sum answer) { System.out.println("더 작게"); } else if (input < answer) { System.out.println("더 큰수"); } }while(input!=..

public class Restart { public static void main(String[] args) { int num = 0; for(int i = 1; i

public class Restart { public static void main(String[] args) { int x = 0; //System.out.printf("x=%d일때, 참인것은%n",x); //%d=정수 출력,%n=줄바꿈 if(x==0) System.out.println("x==0");//x는 0이다(참) ▶출력 if(x!=0) System.out.println("x!==0");//x는 0이 아니다(거짓) if(!(x==0)) System.out.println("!(x==0)");//x는 0이 아니다(거짓) if(!(x!=0)) System.out.println("!(x!==0)");//x는 0이다(이중부정=참) ▶출력 //참인것만 출력됨 x = 1; if(x==0) System.out..

class AA{ public void method(BB b) { b.method(); } }//BB의 매서드를 호출하는 매서드 class BB{ public void method() { System.out.println("BB클래스의 매서드"); } } public class JangRi { public static void main(String[] args) { AA a = new AA(); a.method(new BB()); //BB객체를 만들어서 넣음 //AA객체가 BB객체를 사용해서 BB매서드 호출(=의존) } } 이런 코드에서 새로운 클래스를 추가하면 호출부분들을 다 바꿔야 하는 번거로움이 있는데 인터페이스로 선언부와 구현부를 나눠준다면, ▼ class AA{ public void method..