변수형 boolean을 사용한 간단한 예제입니다.
Java 의 자료형중 하나인 boolean 을 사용하는 간단한 예제 입니다.
*** 원본설명
Vboolean.java
/*
* boolean is simple Java type which can have only of two values; true or false.
* All rational expressions retrun this type of value.
*
* Declare boolean varibale as below
*
* boolean
*
* here assigning default value is optional.
*/
*** 소스
package com.redjava.java.variable;
public class Vboolean {
public static void main(String[] args) {
boolean b1 = true;
boolean b2 = false;
boolean b3 = (10 > 2)? true:false;
System.out.println("Value of boolean variable b1 is :" + b1);
System.out.println("Value of boolean variable b2 is :" + b2);
System.out.println("Value of boolean variable b3 is :" + b3);
}
}
*** 결과
Value of boolean variable b1 is :true
Value of boolean variable b2 is :false
Value of boolean variable b3 is :true
'프로그래밍 Tip > JAVA & JSP' 카테고리의 다른 글
[JAVA] 변수형 long 을 사용한 간단한 예제 (0) | 2015.01.14 |
---|---|
[JAVA] 변수형 short을 사용한 간단한 예제 (0) | 2015.01.08 |
HTTP POST 여러개의 파라미터를 포함한 request 테스트 (0) | 2014.11.17 |
[JAVA source] HTTP POST 여러개의 파라미터를 포함한 request 테스트 (2) | 2014.07.15 |
소켓을 통해 네트워크 정보를 보는 기본적인 예제 (0) | 2014.06.02 |