3초기억력

자바기초)Hello World 본문

자바_기초

자바기초)Hello World

잠수콩 2019. 5. 14. 08:30
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.
public class HelloWorld {

	public static void main(String[] args) {
		// 한줄 주석
		// 여러줄 동시에는 ctrl + / 로 설정, 해제 가능
		
		/*
		 여러줄 주석 
		 여러줄 주석 
		 여러줄 주석 
		 */

		System.out.println("Hello World!");
        
		System.out.println(10);
		System.out.println(1.555);
		System.out.println("호호호호호");	

		// 블럭 선택후 alt + 방향키 위, 아래로 하면 코드 이동이 된다.

		System.out.println(1.25 + 1.250);
		System.out.println("나이는? " + 20 + "살");
		
		System.out.println("1 + 1 은 " + 2 + "입니다.");		//어차피 문자열로 변경된 상황
		System.out.println(1 + 1 + "은 " + 2 + "입니다.");		//앞에는 연산이 된다.
		System.out.println("1 + 1 은 " + (1+1) + "입니다.");	//연산할때는 괄호로 감싼다.
		System.out.println("1 + 1 은 " + 1 + 1 + "입니다.");	//문자열로 바뀐 상황

		// 세미콜론(;) - 문장의 끝을 알려주는 연산자? ; 를 찍지않으면 아래줄까지 영향을 줌.
		
		System.		
			out
			
			.println			
			("dddd");
		
	}

}

'자바_기초' 카테고리의 다른 글

자바기초)Variable 기초문제3  (0) 2019.05.14
자바기초)Variable 기초문제2  (0) 2019.05.14
자바기초)Variable 기초문제1  (0) 2019.05.14
자바기초)Variable2  (0) 2019.05.14
자바기초) Variable1  (0) 2019.05.14
Comments