Bài viết này tôi sẽ hướng dẫn cách để chuyển đổi kiểu dữ liệu short primitive thành kiểu dữ liệu Short trong ngôn ngữ lập trình Java.
Mã nguồn - Source Code
/**
* @(#)ConvertShortPrimitiveToShort.java
*
* ConvertShortPrimitiveToShort application
*
* @author Bui Ngoc Son
* @web vnlives.net
* @version 1.00 2014/6/12
*/
public class ConvertShortPrimitiveToShort {
public static void main(String[] args) {
//Declare new short primitive object.
//Khai báo đối tượng primitive object.
short s = 8;
//Use Short(short s) constructor.
//Sử dụng constructor Short(short s).
Short sObj = new Short(s);
System.out.println("short pritive converted to Short: " + sObj);
}
}
* @(#)ConvertShortPrimitiveToShort.java
*
* ConvertShortPrimitiveToShort application
*
* @author Bui Ngoc Son
* @web vnlives.net
* @version 1.00 2014/6/12
*/
public class ConvertShortPrimitiveToShort {
public static void main(String[] args) {
//Declare new short primitive object.
//Khai báo đối tượng primitive object.
short s = 8;
//Use Short(short s) constructor.
//Sử dụng constructor Short(short s).
Short sObj = new Short(s);
System.out.println("short pritive converted to Short: " + sObj);
}
}
Kết quả - Result
No comments:
Post a Comment