QUESTION 18 A team of programmers is involved in reviewing a proposed design for a new utility class. After some discussion, they realize that the current design allows other classes to access methods in the utility class that should be accessible only to methods within the utility class itself. What design issue has the team discovered? A. Tight coupling B. Low cohesion C. High cohesion D. Loos..
문제 : // TODO arr 배열 에 담긴 모든 값을 더하는 프로그램을 완성 package day04;public class Exam08_02_3 {public static void main(String[] args) {int sum = 0;int[] arr = {10, 20, 30, 40, 50}; //arr int배열 생성,초기화for(int i=0; i
Quesion : 1+(-2)+3+(-4)+... 과 같은 식으로 계속 더해나갔을 때 몇까지 더해야 총합이 100 이상이 되는지 구하시오 .package day04;public class Exam08_02_2 {public static void main(String[] args) {int Sum = 0 ; // 합계를 담아줄 Sum 변수 int a = 1 ; // 증가값 int Time = 0; // Count 변수 while(Sum
package day01;import java.util.Scanner;public class Exam1 {public static void main(String[] args) {System.out.println("yes를 입력해 주세요.");Scanner keyboard = new Scanner(System.in); String input = keyboard.nextLine();if(input.toLowerCase().equals("yes")) // toLowerCase() : 소문자 치환 , equals() : 문자열 비교연산{System.out.println("true");}elseSystem.out.println("false");keyboard.close(); keyboard.null;}}
package day04;import java.util.Arrays;public class P193 {public static void main(String[] args) {char[] chars = new char[5]; // char --> default 초기화 == ' ' == 공백문자로 초기화chars[0] = 'A';chars[1] = 'B';chars[2] = 'C';chars[3] = 'D';System.out.println(Arrays.toString(chars));char[] char2 = { 'a', 'b', 'c', 'd', ' ' }; // 비어 있는 데이터도 방이 만들어 질 것이기 때문에 .System.out.println(Arrays.toString(char2));for (cha..
코딩을 하다보면 배열 전체를 복사할 경우가 생긴다.그때 사용해 주는 것이 있다.System.arraycopy 이다. 형태 : arraycopy(Object src , int srcPos, object dest, int destPos, length)Object src : 배열원본srcPos : 소스 배열을 어디부터 복사시킬 것인지dest : 위치시킬 배열destPos : 위치시킬 배열의 시작 데이터 위치 length : 복사되는 배열 요소의 수 소스 코드를 보면서 이해해 보도록 하자. package day01;import java.util.Arrays;public class Exam1 {public static void main(String[] args) {String [] a = new String[20..