API 7

JAVA 코딩 API (Application Programming Interface) - String, Object

api.io.object import java.io.FileOutputStream; import java.io.IOException; import java.io.ObjectOutputStream; public class Test01 { public static void main(String[] args) { int[] data = new int[] {4,1,9,15,11,6,2}; boolean[] flag = new boolean[] {true,true,false}; String day = "WED"; //객체 입출력 ObjectOutputStream oos = null; try { oos = new ObjectOutputStream(new FileOutputStream("arrays.txt")); /..

Backend/JAVA 2023.03.03

JAVA 코딩 API (Application Programming Interface) - Math, System, Date, Scanner

api.lang.Math : 수학 계산 클래스 public class Test01 { public static void main (String[] args) { double a = 1.5; System.out.println(Math.floor(a)); // 버림 System.out.println(Math.round(a)); // 반올림 System.out.println(Math.ceil(a)); // 올림 int b = 3; int c = 4; System.out.println(Math.pow(b, 3)); // 제곱근 구하기 System.out.println(Math.pow(c, 2)); // 제곱근 구하기 double d = Math.pow(b, 2) + Math.pow(c, 2); double e ..

Backend/JAVA 2023.03.03

JAVA 코딩 API (Application Programming Interface) - File

API - File java.io.File : 파일과 폴더를 구별하지 않고 함게 관리하는 클래스 import java.io.File; public class Test01 { public static void main (String[] args) { File f = new File("sample.txt"); System.out.println(f.exists()); // 대상 파일이 존재하는가? System.out.println(f.isFile()); // 대상이 파일인가? System.out.println(f.isDirectory()); // 대상이 폴더인가 // 파일 정보 System.out.println(f); System.out.println(f.getName()); // 파일명 System.out...

Backend/JAVA 2023.03.02

JAVA 코딩 API (Application Programming Interface) - Collections Framework

Collections Framework : 무한의 데이터를 저장할 수 있는 공간 최소한의 자원으로 최대한의 효율을 낼 수 있도록 만든 프로그램의 기본 틀 ; 반 강제성을 가지고 있는 프로그램의 기본 틀 -> 결국 클래스들의 모음 Framework 최소한의 자원으로 최대한의 효율을 낼 수 있도록 만든 프로그램의 기본 틀 Collection을 상속받은 애들 : 요소 안에 데이터를 저장하는 형태 1. set : 데이터 중복 불가, 데이터 간 순서 없음 전체의 데이터를 가져오거나 넣을 때 주로 이용된다 2. List : 데이터 중복 가능, 데이터간의 순서가 유지된다 확장형 배열 인덱스값을 사용하여 데이터를 중간에 가져오거나 할 수 있다 주로 목록화된 데이터의 검색과 수정이 많이 이루어져야 하는 경우 사용된다 M..

Backend/JAVA 2023.02.23

JAVA 코딩 API (Application Programming Interface) - Integer, Exception

JAVA 코딩 객체지향프로그래밍 OOP, 클래스 Class, 함수, 메소드 https://developernew.tistory.com/21 JAVA 코딩 객체지향프로그래밍 OOP, 클래스 Class, 함수, 메소드 객체 지향 프로그래밍(OOP: Object Oriented Programming) 객체 중심의 프로그래밍 방식 객체끼리의 상호 작용을 통하여 프로그램을 작성하는 방식 부품화 캡슐화 == 클래스 속성과 기능을 하나의 캡슐처 developernew.tistory.com JAVA 코딩 객체지향프로그래밍 OOP, 클래스 Class, static https://developernew.tistory.com/22 JAVA 코딩 객체지향프로그래밍 OOP, 클래스 Class, static 자바 클래스 기본개념..

Backend/JAVA 2023.02.23