분류 전체보기

    [Java Study] API와 UI의 개념

    Program - 시간의 순서에 따라 실행된다 (시간) Application - java가 제공하는 부품을 응용 (응용) Application을 하기 위한 조작장치 -> Application Programming Interface (API) 이 결과물을 사람이 사용할 때 조작하기 위한 것 -> User Interface (UI)

    [Java Study] 입력과 출력

    [Java Study] 입력과 출력

    import org.opentutorials.iot.DimmingLights; import org.opentutorials.iot.Elevator; import org.opentutorials.iot.Lighting; import org.opentutorials.iot.Security; import javax.swing.*; public class OkJavaGoingHomeInput { public static void main(String[] args){ String id = JOptionPane.showInputDialog("Enter a ID"); String bright = JOptionPane.showInputDialog("Enter a Bright level"); // Elevator cal..

    [Java Study] 인텔리제이(intellij) 디버거 사용하기

    [Java Study] 인텔리제이(intellij) 디버거 사용하기

    버그를 잡기 위해, 혹은 프로그램 흐름을 살펴보며 데이터 값을 확인하기 위한 디버거 기능을 사용해보자. 디버그 모드에 진입하는 것은 Run -> Debug...로 시작한다. 줄 번호 옆에 마우스 왼쪽 버튼을 누름으로써 Break Point를 지정할 수 있다. 디버깅을 진행할 때 프로그램은 이 곳에서 멈춘다. 하단에 위치한 디버깅 툴에서는 다음 줄으로 넘기기, 다음 Break Point가 있는 곳 까지 프로그램 진행, 등등... 여러가지 기능들이 있고, 프로그램이 실행되며 데이터가 저장되는 구조, 어떤 변수에 무엇이 들어있는지 등등 구체적인 내부 과정을 알 수 있다.

    [Java Study] 간단한 IoT 구현하기

    [Java Study] 간단한 IoT 구현하기

    import org.opentutorials.iot.Elevator; import org.opentutorials.iot.Lighting; import org.opentutorials.iot.Security; public class OkJavaGoingHome { public static void main(String[] args){ String id = "JAVA APT 507"; // Elevator call Elevator myElevator = new Elevator(id); myElevator.callForUp(1); // Security off Security mySecurity = new Security(id); mySecurity.off(); //Light on Lighting hallLa..

    [Java Study] 데이터 타입의 변환 (Casting)

    public class Casting { public static void main(String[] args){ double a = 1.1; double b = 1; double b2 = (double) 1; System.out.println(b); // int c = 1.1; // error! double -> int impossible double d = 1.1; int e = (int) 1.1; System.out.println(e); String strI = Integer.toString(1); System.out.println(strI.getClass()); } } 1.0 1 class java.lang.String 데이터 타입의 변환 (Casting)에 대하여 알아보았다. 주의할 점 몇가지만 ..

    [Java Study] 변수의 정의

    public class main { public static void main(String[] args) { int a = 1; //Number -> integer System.out.println(a); double b = 1.1; //real number -> double System.out.println(b); String c = "Hello world"; System.out.println(c); } } 1 1.1 Hello world 변수를 이용하여 데이터를 다룰 때 기본적인 자료형에 대해 알아보았다. 이건 C언어의 방법과 동일했다. 문득 main 함수를 선언할때 적어주는 String[] args 는 무슨 의미를 담고 있을지 궁금해졌다.. 구글링을 좀 해보니.. tistory mozi 님의 게시글..

    [Java Study] 문자열 replace 함수

    public class main { public static void main(String[] args) { System.out.println("Hello World".length()); System.out.println("Hello, [[choi]]... bye.".replace("[[choi]]", "kim")); } } 11 Hello, kim... bye 문자열로 표현할 때 사용할 수 있는 length 함수와 replace 함수에 대하여 실습을 진행 해 보았다. C언어는 이런 함수들이 특정 헤더에 들어있어 사용이 필요할 때마다 찾아봐야 하는 번거로움이 있었지만 자바는 기본적으로 제공되는 다양한 함수들이 있는 듯 했다.

    [Java Study] 문자열의 표현

    public class main { public static void main(String[] args) { //String, Character System.out.println("Hello, world!"); //String 문자열 Character들의 집합체 System.out.println('H'); //Character 문자 하나 System.out.println("H"); System.out.println("Hello" +"world!"); System.out.println("Hello \nworld"); //New line System.out.println("Hello \"world\""); //Hello "world" } } Hello, world! H H Helloworld! Hello w..

    [Java Study] 숫자의 연산

    public class Number { public static void main(String[] args){ //Operator System.out.println(6+2); //8 System.out.println(6-2); //4 System.out.println(6*2); //12 System.out.println(6/2); //3 System.out.println(Math.PI); System.out.println(Math.floor(Math.PI)); //내림 System.out.println(Math.ceil(Math.PI)); //올림 } } 8 4 12 3 3.141592653589793 3.0 4.0 간단한 숫자의 연산을 프로그래밍 해 보았다. C언어에서의 math.h 기능이 Math. ..

    [Java Study] java 데이터 타입(숫자, 문자)

    public class Data_and_Operation { public static void main(String[] args){ System.out.println(6); //Number System.out.println("six"); //String System.out.println("6"); //String 6 System.out.println(6+6); //12 더하기연산자 System.out.println("6"+"6"); //66 결합연산자 System.out.println(6*6); //36 // System.out.println("6"*"6"); System.out.println("1111".length()); // System.out.println(1111.length()); //에러! ..