MultiQuiz/Java4 3.28 mulQuiz Interface /* * 1. 자바에서 인터페이스는 추상 메소드와 (상수 )만을 포함하며, ( interface) 키워드를 사용하여 선언한다. * 2. 인터페이스를 구현할 때 ( implements ) 키워드를 사용하며, 인터페이스의 모든 메소드를 구현한다 * 3. 추상클래스와 인터페이스의 (객체)는 생성 할 수 없다. * 4. 인터페이스에 대한 설명으로 틀린 것은 무엇입니까? (3 ) * 인터페이스는 인스턴스 필드를 가질 수 있다. * 5. 인터페이스의 다형성과 거리가 먼 것은? ( 4) * 구현 객체를 인터페이스 타입으로 변환하려면 강제 타입 변환을 해야 한다 * 6. 인터페이스는 추상 메소드, 상수, 필드로 구성된다.(x) -> 추상메소드와 상수로만 구성된다. */ 7. 인터페이스 AdderInterface의 코드.. 2023. 3. 30. 3.23 Java MultiQuiz 6 (함수) 1. 메소드에 대한 설명으로 틀린 것은 무엇입니까 1- 3.메소드의 이름은 중복해서 선언할 수 없다. 2. 메소드 오버로딩에 대한 설명으로 틀린 것은? 2-2 반드시 리턴 타입이 달라야 한다 3. 코드 실행 결과는 public static void main(String[] args) { int max=0; int valueMax=max(10, 20, max); System.out.println("max:" + valueMax); } public static int max(int a, int b, int max){ if(a > b) max=a; else max=b; return max;}} max 값 : 20 4. 괄호에 맞는 내용 입력하시오. public static void main(String[] a.. 2023. 3. 24. 3.22 Java 4(조건문,반복문) 1.조건문과 반복문을 설명한 것 중 틀린 것은 무엇입니까? 4번 break문은 switch문, for문, while문을 종료할 때 사용할 수 있다 - 탈출할 때 쓰인다. * 2. 2-1switch 문 2-2 coutinue 문 2-3 break 문 * 3. public class Example { public static void main(String[] args){ int i=0, sum=0; while(i=10) break; if(num%3==0) continue; System.out.print(num + "\t"); } }}} 답 : 1 2 4 5 7 8 5. 출력값을 10, 9, 8..... 1 순으로 정수를 출력하는 프로그램을 만들려고 합니다. 괄호 안에 알맞은 식을 작성하세요. public c.. 2023. 3. 23. 3.21 Java quiz 1,2,3 1 번 package Quiz; public class MyinfoApp { public static void main(String[] args) { System.out.println("Kiate Hwong"); System.out.println("20 years old"); System.out.println("Department of Computer Engineering"); String name = "홍길동"; } } /* 2번 * 2-1 . int 2-2 float 2-3 boolean * * 3번 * 3-1 줄바꿈 3-2 byte,short,int,long 정수 숫자구함 3-3 double, float * * 4번 * 4-1 4byte 4-2 2byte 4-3 8byte 4-4 2byte 4-5 .. 2023. 3. 22. 이전 1 다음