일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
- JavaScript
- property
- jQuery
- function
- 파일 입출력
- spring
- 상속
- html
- 연락처 프로그램
- File 클래스
- GUI
- 코틀린#클래스#상속
- array
- Method
- String
- 데이터베이스
- list
- 연산자
- 오라클
- jsp
- 다형성
- 자바
- Java
- springframework
- css
- kotlin #return #jump
- 윈도우 #단축키
- javaservlet
- Event
- 설치
- Today
- Total
목록Java (17)
Binary World
* 과제: 피보나치 수열 20개를 출력피보나치(Fibonacci) 수열: 1, 1, 2, 3, 5, 8, 13, 21, ...f[0] = 1f[1] = 1f[n] = f[n-1] + f[n-2], n >= 2 1) 정수 20개를 저장할 수 있는 배열 선언2) 배열의 인덱스 0번째, 1번째 원소는 1로 초기화3) 배열의 인덱스 2번째 원소부터 19번째 원소까지는 반복문을 사용해서 초기화4) 배열의 내용을 출력 public class HomeworkMain02 { public static void main(String[] args) {// 피보나치 수열 20개를 출력int[] pivo = new int[20];pivo[0] = 1;pivo[1] = 1;for(int i=2; i < pivo.length; i..
*MethodMain02(사칙연산 메소드 생성) public class MethodMain02 { // 메소드 이름: add// 기능: 두 개의 정수를 매개변수로 전달 받아서, 두 정수의 합을 리턴// 리턴 타입: int// 매개변수: int x, int ypublic static int add(int x, int y) {return x + y;} // end add // 메소드 이름: sub// 기능: 정수 두 개를 전달 받아서, 그 차를 리턴// 리턴 타입: int// 매개변수: int x, int ypublic static int sub(int x, int y) {return x - y;} // end sub // 메소드 이름: mul// 기능: 두 개의 실수를 전달 받아서 두 수의 곱을 리턴하는 ..
1. 반복문을 사용해서, 'A'부터 'Z'까지 출력하는 프로그램 2. 다음과 같이 출력하는 프로그램*************** 3. sum = 1 + (-2) + 3 + (-4) + 5 + .... + n >= 100 을 만족하는 n과 sum의 값을 출력 public class HomeworkMain02 { public static void main(String[] args) {// 1. 반복문 사용, 'A'부터 'Z'까지 출력char ch = 'A';for (int i = 1; i < 27; i++){System.out.println(ch);ch ++;}System.out.println("============");// 2. 별표 출력하기for(int i = 1; i
*ArrayMain02(배열의 선언, 초기화, 출력) public class ArrayMain02 { public static void main(String[] args) {System.out.println("배열의 선언, 초기화, 출력");// int 10개를 저장할 수 있는 배열 선언int[] array = new int[10];// 배열의 길이를 출력System.out.println(array.length);System.out.println("===============");// 배열의 인덱스 : 0 ~ (length - 1)// for문을 사용한 배열의 초기화for (int i = 0; i < array.length; i++) {array[i] = (i + 1) * 10;}// for문을 사용한 ..
* ForMain01(for반복문) public class ForMain01 { public static void main(String[] args) {System.out.println("for 반복문");for(int x=1; x
*IfMain01 public class IfMain01 {public static void main(String[] args){System.out.println("if-else 문");int x = 100;if (x > 0){System.out.println("양수");} else {System.out.println("0보다 크지 않음");}System.out.println("첫번째 if-else 끝");System.out.println("==================");int y = 100;if(y > 0){System.out.println("양수입니다!");} else {System.out.println("0보다 크지 않습니다.");}} // end main()} // end class IfM..
* OperatorMain01(자바의 계산) public class OpMain01 { public static void main(String[] args) {System.out.println("[1] 대입 연산자(=)");// 변수 = 값;// 오른쪽의 값을 왼쪽의 변수에 저장하는 연산자int number = 123;System.out.println("number = " + number);System.out.println("===============");System.out.println("[2] 산술 연산자(+, -, *, /, %)");// (정수) / (정수) : 나눈 몫을 계산// (정수) % (정수) : 나눈 나머지르르 계산// (실수) / (실수), (실수) / (정수), (정수) / (실수..
* Primitive Data type : boolean, Numeric Type * Numeric Type : Integral Type , Floating-Point Type * Integral Type : byte, short, int, long, char * Floating-Point Type : float, double * Reasoning of classified is different of saving byte. It is necessary in optimization. byte : 1 byte =(8 bits) -> -128 ~ 127short : 2 byte = (16 bits) -> -32,768 ~ 32,767int : 4 byte = (32 bits) long : 8 bytechar ..