---
title: "java对中文的支持"
author: "unique5945"
date: "2008-03-31T20:59:57Z"
tags: []
slug: "java"
draft: false
lastmod: "2008-03-31T20:59:57Z"
id: 178190
url: "https://unique5945.iteye.com/blog/178190"
---

今天发现java对中文的支持如此之强！
做了以下测试，全部编译通过，运行成功！呵呵！


```java
public class 强 {
	public static void main(String[] args) {
		
		System.out.println(args[0]+":"+动作(args[0]));
		System.out.println(静态方法(1));
		静态方法2();
		new 强().类方法();
		new 强().另一个类方法();
	}
	
	static String 动作(String 人名){   
        if("唐僧".equals(人名)){   
              return   "人是人他妈生的,妖是妖他妈生的.你妈贵姓啊?";   
        }else   if("小妖甲".equals(人名)){   
              return   "我受不了啦－－！（拔刀自尽）";   
        }else   if("小妖乙".equals(人名)){   
              return   "啊－－！（精神崩溃）";   
        }else   return   "......";   
    }
	static String 静态方法(int i){//有返回值的中文函数必须带参数
		String 名字 = "我是谁";
		return 名字;
	}
	static void 静态方法2(){//无返回值的中文函数可以不带参数
		String 名字 = "我是谁";
		System.out.println(名字);
	}
	String 类方法(){
		return "类方法";
	}
	void 另一个类方法(){
		System.out.println("在另一个类方法里");
	}
}
```