기본문법
: System.out.println("Hollo World!");
: js의 console.log("Hello World!");
와 같음
: 파일 우클릭 후 Run / 편집 페이지 안에서 Run | Debug 중에서 Run / F5 누르기
int a = 1;
float b = 1.5f;
char c = 'a';
String d = "Hello";
package com.example;
public class App
{
public static void main( String[] args )
{
int x = 10, y=5;
// syso만 쳐도 나옴 = js의 console.log();
System.out.println("syso!!");
// typescript => type을 명시하는 js
// Type을 명시해야함 (중요!)
int a = 1; // 정수 1을 a변수에 넣어라
float b = 1.5f; // 실수 1.5를 b변수에 넣어라
char c = 'a'; // 문자1개 a를 c변수에 넣어라
String d = "Hello"; // 문자열 Hello를 d변수에 넣어라
System.out.println("a변수 값은 : "+a);
System.out.println("b변수 값은 : "+b);
System.out.println("c변수 값은 : "+c);
System.out.println("d변수 값은 : "+d);
// JAVA에서 object(객체)를 만드는것을 class라고 함
}
}
다음시간에 class 생성