일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 코틀린
- TypeScript
- stylesheet
- JavaScript
- array
- Javscript
- TextView
- GoogleMaps
- SpringBoot
- Kotlin
- 리액트
- 자바스크립트
- 오버라이딩
- 구글맵스
- 랜덤번호
- Linux
- Java
- React
- 랜덤넘버
- 안드로이드
- nodejs
- 스프링부트
- JS
- RecyclerView
- fragment
- Android
- npm
- scrollview
- button
- Hook
- Today
- Total
목록분류 전체보기 (169)
타닥타닥 개발자의 일상
OOP ( Object Oriented Programing ) 프로그램의 구조, 관리때 쓰이는 기법 객체 지향 프로그래밍 특징 1. 은닉성(캡슐화) 2. 상속성 3. 다형성 형식: class 명 { variable method } public class OOP { public static void main(String[] args) { MyClass cls = new MyClass(); cls.method(); cls.number =1; cls.name = "홍길동"; MyClass cls1 = new MyClass(); cls1.number =2; cls1.name ="성춘향"; cls1.method(); TV tv1=new TV(); tv1.isPowerOn=true; tv1.channel=23; t..
import java.util.Arrays; import java.util.Scanner; public class Sorting { int number[]; int updown; void input() { Scanner sc =new Scanner(System.in); System.out.print("몇개 정렬?"); int count = sc.nextInt(); number = new int[count]; for (int i = 0; i < number.length; i++) { System.out.print((i+1)+"번째 수 = "); number[i] = sc.nextInt(); } System.out.println("오름(1)/내림(2) ="); updown =sc.nextInt(); } vo..
class Exercise1 { public static void main(String args[]) { Student s = new Student(); s.name = "홍길동"; s.ban = 1; s.no = 1; s.kor = 100; s.eng = 60; s.math = 76; System.out.println("이름:"+s.name); System.out.println("총점:"+s.getTotal(s.kor, s.eng, s.math) ); System.out.println("평균:"+s.getAverage( ) ); } } [실행결과] 이름:홍길동 총점:236 평균:78.7 class Student { /* (1) 알맞은 코드를 넣어 완성하시오. */ } public class Studen..
// 학생들의 정보를 2차원배열에 입력을 받는다 (이름, 생년월일, 국어, 영어, 수학) //2차원 배열을 이용하여 학생들 개개인의 국영수 총점, 학생들의 국어 점수 총점, 학생들의 등수를 출력하라 import java.util.Arrays; import java.util.Scanner; public class StudentA { public static void main(String[] args) { String student[][] = { // 국어 영어 수학 { "홍길동", "1999-01-23", "100", "90", "75" }, { "성춘향", "2010-07-04", "90", "100", "95" }, { "일지매", "2001-03-05", "85", "95", "100" }, }; i..
package fileWork; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; import java.util.Arrays; public class MainClass { public static void main(String[] args) { // String 에 있는 변수 3개 파일로 저장하고 저장된 파일 불러와서 배열로 저장한 다음 출력하기 ..
1.파일 생성하고 글쓰기 import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; public class MainClass { public static void main(String[] args) { File file = new File("c:\\myfile\\writeData.txt"); //file 은 c드라이브 my filee에 있는 writeData 텍스트 파일을 생성 파일이 없으면 만들어 버리거나 있는 파일을 덧씌워버린다. 따라서 쓰기전에 파일 존재부터확인 try { FileWriter fw = new FileWr..
1. Filereader를 통해 파일 한글자씩 읽기 import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; public class MainClass { public static void main(String[] args) { File file = new File("c:\\myfile\\newfile.txt"); //newfile에는 hello 안녕하세요가 입력되어있다. try { FileReader fr = new FileReader(file); //newfile이란 텍스트 파일을 읽는 변수 fr int..
1.파일 조사하기 입력 출력 File file = new File("c:\\"); //file은 c:에 있는 파일 //파일 조사 String filelist[] = file.list(); for (int i= 0; i
public class MainClass { public static void main(String[] args) { int array2[][] = { {1,2,3,4}, {5,6,7,8}, {9,10,11,12}, //array2 정의 }; int array1[] = array2ToArray1(array2); } static int[] array2ToArray1(int array2[][]) { //함수의 프로토 타입 2차원 배열이 parameter int array1[] = new int[ array2.length*array2[0].length]; //array2.length=행의 수, array2[0].length=열의 수 /* i = 0 1 2 j =0 1 2 3 array2[0].length*i+..
import java.util.Arrays; import java.util.Scanner; public class MainClass { System.out.print("숫자를 넣어주세요 :"); String quest4 = sc.next(); // 입력받은 숫자는 문자열 자료형 boolean answer4 = isDouble(quest4); //answer4 는 quest4라는 문자를 isDouble이라는 함수에 넣은 값 System.out.print("입력한 숫자 " + quest4 + "는"); // quest4는 ture 혹은 false System.out.println(answer4 ? "실수입니다!" : "정수입니다!"); // answer4가 true면 실수고 아니라면 정수라는 출력조건 } s..