변수형 short을 사용한 간단한 예제입니다.

 

Java 의 자료형 중 하나인 short 를 활용한 간단한 예제 입니다.

 

*** 원문

Vshort.java

* short is 16 bit signed type ranges from ?32,768 to 32,767.

*
* Declare short varibale as below
* 
* short = ;
* 
* here assigning default value is optional.
*/

 

 

 

 

*** 소스

package com.redjava.java.variable;

public class Vshort {
 
 
 public static void main(String[] args) {
   short s1 = 50;
      short s2 = 42;

   System.out.println("Value of short variable b1 is :" + s1);
   System.out.println("Value of short variable b1 is :" + s2);
  
 }

}

*** 결과

Value of short variable b1 is :50
Value of short variable b1 is :42

 

블로그 이미지

슬픈외로움

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

,