일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- webpack
- snowpack
- 스타일보험
- SQL
- java#왕초보
- React
- 상속
- 쿠키
- 스프링
- sub query
- 함수
- degit
- FIle
- parcel
- java
- 숫자
- 버전일치
- kotlin
- 시큐어코딩
- Spring
- Android
- 게시판
- 미니게임
- git
- 왕초보
- 오버라이드
- 답글
- Spinner
- 코틀린
- 안드로이드
- Today
- Total
목록Coding (130)
YSHUSH

˙ Over Load : 함수 명은 같고 매개변수(parameter)의 자료형이나 갯수가 다른 것을 의미. 쉽게 말하면 '동명이인' 예) paint() : image drawing paint(int x, int y) paint(int z) paint(char c) paint(char c, int i) void paint(int i, char c) 적용X의 예) void paint(int n, char ch) X int paint(int i, char c) X public class MainClass { public static void main(String[] args) { method(); method('A'); method(10); method('B', 12); method(14, 'C'); int ..

˙ function : 함수. 독립적 ˙ method : class에 소속된 함수. ˙ 형식: parameter = 인수, 인자, 게타(getter) 돌아오는 값의 자료형 함수명(들어가는 값의 자료형 변수, 들어가는 값의 자료형 변수, ...) { 처리 return 값;// return value } void -> 자료형이 없는 것 int i = functionName('A');// 'A' == argument System.out.println(i); String st = "abcDEF"; String upst = toUpperCase(st); System.out.println(upst); functionName1(); functionName2(6.2, 0); int r = functionName3();..

#1. 변수의 문자가 숫자로만 되어 있는지 아니면 다른 문자인지를 판별하라 // 1. 변수의 문자가 숫자로만 되어 있는지 아니면 다른 문자인지를 판별하는 코드 // 예를 들어 char str = "A"; 일때 char c = 'A'; System.out.println((int)c); // 아스키코드 변환(int) int asccode = (int)c; boolean numberOK = true; if(asccode 57) { numberOK = false; } //숫자입니다 if(numberOK) { System.out.println("숫자입니다"); } //숫자가 아닙니다. else { System.out.println("숫자가 아닙니다"); } #2. 입력된 문자열이 ..

/* String : Wrapper class char[] 문자열을 편집, 정보취득 등등 */ String str; // String : class 명칭 // str : class 변수 == object(객체) str = "안녕하세요"; System.out.println(str); String str1 = new String("안녕하세요"); String str2 = "반갑습니다.";//1과 2는 동일한 과정 // 문자의 결합 String str3 = str1 + str2; System.out.println(str3); str3 = str3 + "건강하세요"; System.out.println(str3); // equals : 문자열을 비교 String str4 = "world"; String str5 ..

˙ Wrapper Class란? 일반 자료형(char, int, double)을 사용하기 편리하도록 구현해 놓은 것 "문자열" '가' '나' '다' 'h' 'e' 'l' 'l' 'o' -> 하나의 문자들을 모은 것 String: 원래는 자료형이 아님 -> Wrapper Class :도구상자라고 생각하면 됨 char chArr[] = { 'h' 'e' 'l' 'l' 'o' }; /* 일반 자료형 Wrapper Class(object) ------------------------------------------------ booleanBoolean byteByte shortShort intInteger------ longLong floatFloat doubleDouble------ charCharacter ..

/* 숫자 입력 5개로 음수가 입력되면 다시 입력한다. */ int[] inputNum = new int[5]; int w = 0; while(w 0) {// 정상입력 inputNum[w] = num; } else { System.out.println("0 이상의 수를 입력해 주십시오"); continue; } w++; } System.out.println(Arrays.toString(inputNum));

Scanner sc = new Scanner(System.in); /* 사용자가 원하는 학생수로 점수를 입력을 받는다. 총점, 평균 그리고 최고점수를 구한다. 입력 받은 점수 중에서 90점 이상인 학생의 수는 몇명인가? 그리고 그 점수들만을 새로운 배열에 저장하도록 한다. */ int count = 0; int number[] = null;//동적할당을 해줘야 하는 요소의 초기화는 null // 입력 // 몇명? System.out.print("몇명의 통계를 구하시겠습니까? = "); count = sc.nextInt(); number = new int[count]; // 학생들의 점수 입력 for(int i = 0; i < number.length; i++) { System.out.println((i ..

˙ continue : skip(생략) loop문과 같이 사용한다.(단독으로 사용 불가) while( 조건문 ) { 처리1 처리2 if(조건) { continue; } 처리3 3) { continue;// continue문 밑에있는 작업들은 모두 생략 } System.out.println("for end"); } // i = 3이후로 continue문 밑에 있는 for end값이 출력되지 않음 ˙ continue문 기초 - 무한루프 int w = 0; while (w 3) { continue; } System.out.println("while end"); w+..

˙ break == 탈출(escape) loop를 멈춘다. switch, for, while, do while문에서 사용 switch(variable) { case value: processing break; } for(int i = 0; i break를 걸면 조건이 맞을경우 탈출 } } w = 0; while(w < 100) { if(조건) { break; } w++; } ˙ break 기초 for(int i = 0; i < 10; i++) { System.out.println("for loop " + i); if(i == 5) { break; } } //행 안에서 break문으로 값찾기 int array[] = { 1, 4, -7..