변수형 float을 사용한 간단한 예제입니다.
JAVA의 자료형중 하나인 float 형을 활용하는 간단한 예제 입니다.
*** 원문
// float 선언 및 값 대입
float f = 10.4f;
Vfloat.java
/*
* float is 32 bit single precision type and used when fractional precision
* calculation is required.
*
* Declare float varibale as below
*
* float
* here assigning default value is optional.
*/
*** 소스
package com.redjava.java.variable;
public class Vfloat {
public static void main(String[] args) {
float f = 10.4f;
System.out.println("Value of float variable f is :" + f);
}
}
*** 결과
Value of float variable f is :10.4
'프로그래밍 Tip > JAVA & JSP' 카테고리의 다른 글
[JAVA] charArray을 사용한 간단한 예제 (0) | 2015.01.26 |
---|---|
[JAVA] 변수형 double을 사용한 간단한 예제 (0) | 2015.01.26 |
[JAVA] 변수형 int을 사용한 간단한 예제 (0) | 2015.01.26 |
[JAVA] 변수형 long 을 사용한 간단한 예제 (0) | 2015.01.14 |
[JAVA] 변수형 short을 사용한 간단한 예제 (0) | 2015.01.08 |