JAVA基本数据类型

---恢复内容开始---

public class DataType 
{

    public static void main(String[] args) 
    {
        //基本数据类型
        
        //定义byte类型的变量
        byte a=127;
        
        short s=22288;
        
        int d=38124279;
        
        //默认int型,long型后头加L或l
        long f=123445567343563456L;
        
        
        //小数浮点型默认double型
        double z=1323.1223;
        double c=23.12434243;
        
        
        float x= 1.224434353f;
        
        //字符型
        
        char n='s';
        char m='我';
        System.out.println(m+"是"+n);
        
        c=34.4;
        System.out.println(c);
        
        
        //字符集 java utf-8(博客园)
        
        boolean p1=true,p2=false;
        System.out.println(p1+"+"+p2);
        
        int k='l';
        System.out.println(k);
        
        
        System.out.println("一句话\n换行");
        System.out.println("一句话\r回车");
        System.out.println("一句话\t制表符");
        System.out.println("这是一句话\t制表符");
        
        
        


 

 

 

java输出utf8编码

 

 

UTF-8(8-bit Unicode Transformation Format)是一种针对Unicode的可变长度字符编码,又称万国码。由Ken Thompson于1992年创建。现在已经标准化为RFC 3629。

UTF-8用1到6个字节编码UNICODE字符。用在网页上可以同一页面显示中文简体繁体及其它语言(如英文,日文,韩文)。


 

-

posted @ 2016-02-22 09:05  百事没事  阅读(317)  评论(0编辑  收藏  举报