일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- scrollview
- fragment
- 안드로이드
- 랜덤넘버
- Linux
- RecyclerView
- 코틀린
- 스프링부트
- JavaScript
- React
- Android
- nodejs
- TextView
- button
- 오버라이딩
- Kotlin
- stylesheet
- JS
- TypeScript
- 자바스크립트
- 구글맵스
- Javscript
- npm
- 리액트
- array
- GoogleMaps
- Hook
- Java
- 랜덤번호
- SpringBoot
- Today
- Total
목록전체 글 (169)
타닥타닥 개발자의 일상
public class MainClass { public static void main(String[] args) { int x1, y1, x2, y2; //좌표상의 x,y값은 다 정수이므로 청수로 초기화. x1 = 0; y1 = 0; x2 = 0; y2 = 0; double dis = distance(x1, y1, x2, y2); //distance 함수에 본인이 거리 구하고자하는 좌표값 대입해서 나온 거리 = 실수형 자료 dis System.out.println(dis); } static double distance(double x1, double y1, double x2, double y2) { //실수를 parameter 로 가지는 double함수. double result; //result는 실..
경우1 import java.util.Arrays; import java.util.Scanner; public class MainClass { public static void main(String[] args) { int quest2[] = new int[2]; //정수형 배열 quest2 초기화 int answer2_div[] = new int[2]; //정수형 배열 answer2 초기화 System.out.print("피제수를 넣어주세요 :"); quest2[0] = sc.nextInt(); //quest2[0]에 입력 받은 피제수 대입 do { System.out.print("0을 제외한 제수를 넣어주세요 :"); //먼저 조건 출력 quest2[1] = sc.nextInt(); //입력 받은 수..
import java.util.Arrays; import java.util.Scanner; public class MainClass { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.print("숫자 하나를 넣어주세요 :"); int quest1 = sc.nextInt(); //입력 받은 숫자를 quest1이라는 변수로 지정 char answer1 = ascToChar(quest1); //정답을 answer1이라는 문자형 변수로 지정/ 함수에 입력받은 quest1을 대입. System.out.println("넣은 수 : " + quest1 + "답 : " + answer1); } static ..
import java.util.Scanner; public class MainClass { public static void main(String[] args) { //public static void main 시작 int number1, number2; String oper; int result = 0; // 1.첫번째 숫자 입력 number1 = numberInput("첫번째 수 = "); // 2. 연산자 입력 oper = operatorInput(); //3. 두번째 숫자 입력 number2 = numberInput("두번째 수 = "); //4.연산 result = calculator(number1, number2, oper); // 3.결과 출력 resultPrint(number1, numbe..
function : 함수, 독립적 method : class에 소속되어 있는 함수. void: 자료형이 없는 것 형식 parameter, 인수, 인자 돌아오는 값의 자료형 함수명(들어가는 값의 자료형 변수, 들어가는 값의 자료형 변수....){ 처리 return 값; } 입력 함수 int i = fuctionName('A'); //'A'==argument System.out.println(i); //return값 1이 i에 저장 static int fuctionName(char c) { //parameter System.out.println("fuctionName(char c)호출"); return 1; } 출력 fuctionName(char c)호출 1 toUppercase 구문 없이 함수로 대문자 변..
int array[] = {11,22,33}; int arrAlias[]; //array[]를 복사할 새로운 배열 변수 선언 arrAlias = array; //주소를 복사 좌변과 우변이 같아져서 동일한 주소가 된다. arrAlias[1] =27; //동일한 주소가 되었으므로 aarAlias[1]=27=array[1] 입력화면 System.out.println(arrAlias[1]); System.out.println(array[1]); 출력화면 27 27 입력화면 System.out.println(arrAlias); System.out.println(array); 출력화면 [I@2781e022 //배열의 주소 [I@2781e022 //배열의 주소
입력된 값이 문자인지 숫자인지 판별 import java.util.Iterator; public class Homework1209 { public static void main(String[] args) { char c = 'A'; System.out.println((int)c); //A의 아스키 코드 값 65출력 int asccode = (int)c; //c의 아스키 코드를 정수인 변수값 asccode로 초기화 boolean numberOK = true; //numberOK는 해당 값이 숫자면 true라는 변수 if(asccode 57) { //asccode 57에 해당하면 문자 numberOK = false; //asccode는 56이므..
String: Wrapper class Wrapper class의 문자열을 편집해 정보 취득 등의 기능을 할수 있다. String str; // String : Class 명칭 // Str : Class 변수 == object(객체) 문자열 간의 결합 입력 출력 String str1 = "안녕하세요."; String str2 = "반갑습니다."; String str3 = str1 + str2; System.out.println(str3); str3 = str3 + "건강하세요."; // 문자열 스스로 갱신도 가능 System.out.println(str3); 안녕하세요. 반갑습니다. 안녕하세요. 반갑습니다. 건강하세요. equals 문자열을 비교 입력 출력화면 String str4 = "world"; S..
Integer.to.BinaryString(i) 10진수를 2진수로 Integer.toOctalString(i) 10진수를 8진수로 Integer.toHexString(i) 10진수를 16진수로 2진수를 10진수로 String number2 = "1010101"; int number10 = Integer.parseInt(number2,2) 10진수를 2진수로 바꾸는 예시 입력화면 출력화면 int num10 =16; //정수 16선언 String num2 = Integer.toBinaryString(num10); //정수를 2진수 문자열로 변환 System.out.println(num2); 10000 // 16의 2진수 10진수를 8진수로 바꾸는 예시 입력화면 출력화면 int ten = 64; //정수 6..
Wrapper Class 일반 자료형(char, int, double을) 사용하기 편리하도록 구현해 놓은것 "문자열" '가' '나' '다' 'h' 'e' 'l' 'l' 'o' String - Wrapper Class char chArr[] = {'h' 'e' 'l' 'l' 'o'}; 일반 자료형 Wrapper Class(object) boolean Boolean byte Byte short Short int Integer long Long float Float double Double char Character char[] string 입력 출력 int i = 123; Integer _iobj =new Integer(123); System.out.println("i ="+i); System.out.pri..