'float'에 해당되는 글 1건

 

변수형 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

 

 

블로그 이미지

슬픈외로움

개발이 어려워? 모든것엔 답이있다...

,