package util;

import java.lang.reflect.Array;

public class FirstName {

    public static boolean ClearName(String name){
String[] surName = {
"赵","钱","孙","李","周","吴","郑","王","冯","陈",
"楮","卫","蒋","沈","韩","杨","朱","秦","尤","许",
"何","吕","施","张","孔","曹","严","华","金","魏",
"陶","姜","戚","谢","邹","喻","柏","水","窦","章",
"云","苏","潘","葛","奚","范","彭","郎","鲁","韦",
"昌","马","苗","凤","花","方","俞","任","袁","柳",
"酆","鲍","史","唐","费","廉","岑","薛","雷","贺",
"倪","汤","滕","殷","罗","毕","郝","邬","安","常",
"乐","于","时","傅","皮","卞","齐","康","伍","余",
"元","卜","顾","孟","平","黄","和","穆","萧","尹",
"姚","邵","湛","汪","祁","毛","禹","狄","米","贝",
"明","臧","计","伏","成","戴","谈","宋","茅","庞",
"熊","纪","舒","屈","项","祝","董","梁","杜","阮",
"蓝","闽","席","季","麻","强","贾","路","娄","危",
"江","童","颜","郭","梅","盛","林","刁","锺","徐",
"丘","骆","高","夏","蔡","田","樊","胡","凌","霍",
"虞","万","支","柯","昝","管","卢","莫","经","房",
"裘","缪","干","解","应","宗","丁","宣","贲","邓",
"郁","单","杭","洪","包","诸","左","石","崔","吉",
"钮","龚","程","嵇","邢","滑","裴","陆","荣","翁",
"荀","羊","於","惠","甄","麹","家","封","芮","羿",
"储","靳","汲","邴","糜","松","井","段","富","巫",
"乌","焦","巴","弓","牧","隗","山","谷","车","侯",
"宓","蓬","全","郗","班","仰","秋","仲","伊","宫",
"宁","仇","栾","暴","甘","斜","厉","戎","祖","武",
"符","刘","景","詹","束","龙","叶","幸","司","韶",
"郜","黎","蓟","薄","印","宿","白","怀","蒲","邰",
"从","鄂","索","咸","籍","赖","卓","蔺","屠","蒙",
"池","乔","阴","郁","胥","能","苍","双","闻","莘",
"党","翟","谭","贡","劳","逄","姬","申","扶","堵",
"冉","宰","郦","雍","郤","璩","桑","桂","濮","牛",
"寿","通","边","扈","燕","冀","郏","浦","尚","农",
"温","别","庄","晏","柴","瞿","阎","充","慕","连",
"茹","习","宦","艾","鱼","容","向","古","易","慎",
"戈","廖","庾","终","暨","居","衡","步","都","耿",
"满","弘","匡","国","文","寇","广","禄","阙","东",
"欧","殳","沃","利","蔚","越","夔","隆","师","巩",
"厍","聂","晁","勾","敖","融","冷","訾","辛","阚",
"那","简","饶","空","曾","毋","沙","乜","养","鞠",
"须","丰","巢","关","蒯","相","查","后","荆","红",
"游","竺","权","逑","盖","益","桓","公","仉","督",
"晋","楚","阎","法","汝","鄢","涂","钦","归","海",
"岳","帅","缑","亢","况","后","有","琴","商","牟",
"佘","佴","伯","赏","墨","哈","谯","笪","年","爱",
"阳","佟",
"万俟","司马","上官","欧阳","夏侯",
"诸葛","闻人","东方","赫连","皇甫",
"尉迟","公羊","澹台","公冶","宗政",
"濮阳","淳于","单于","太叔","申屠",
"公孙","仲孙","轩辕","令狐","锺离",
"宇文","长孙","慕容","鲜于","闾丘",
"司徒","司空","丌官","司寇","南宫",
"子车","颛孙","端木","巫马","公西",
"漆雕","乐正","壤驷","公良","拓拔",
"夹谷","宰父","谷梁","段干","百里",
"东郭","南门","呼延","羊舌","微生",
"梁丘","左丘","东门","西门"
}; String firstName = name.substring(,);
for(String s : surName){
String s1 = s.substring(,);
if(s.contains(firstName)){
return true;
}
}
return false; }
public static void main(String[] args) {
String name = "张三";
System.out.println(ClearName(name));
}
}

java判断姓是否合格 百家姓的更多相关文章

  1. java判断姓是否合格 千家姓

    package com.sycx.domain; import java.lang.reflect.Array; public class FirstName { public static bool ...

  2. 使用Java判断字符串中的中文字符数量

    Java判断一个字符串str中中文的个数,经过总结,有以下几种方法(全部经过验证),可根据其原理判断在何种情况下使用哪个方法: 1. char[] c = str.toCharArray(); for ...

  3. Java判断回文数算法简单实现

    好久没写java的代码了, 今天闲来无事写段java的代码,算是为新的一年磨磨刀,开个头,算法是Java判断回文数算法简单实现,基本思想是利用字符串对应位置比较,如果所有可能位置都满足要求,则输入的是 ...

  4. Java 判断操作系统类型(适用于各种操作系统)

    Java 判断操作系统类型(适用于各种操作系统) 最近一段时间写一个授权的程序,需要获取很多信息来保证程序不能随意复制使用,必须经过授权才可以. 为了限制用户使用的操作系统,必须有统一的方法来获取才可 ...

  5. java判断字符串是否为空的方法总结

    http://blog.csdn.net/qq799499343/article/details/8492672 以下是java 判断字符串是否为空的四种方法: 方法一: 最多人使用的一个方法, 直观 ...

  6. Java判断字符串是中文还是英文

    在做开发的时候我们经常需要用到根据某个字符或者字符串来判断其是中文还是英文,从而做相应的处理,其实不难,大多数人们都是用到正则来判断的,下面小贝就给大家分享一下Java判断字符串是中文还是英文 推荐文 ...

  7. (转)java判断string变量是否是数字的六种方法小结

    java判断string变量是否是数字的六种方法小结 (2012-10-17 17:00:17) 转载▼ 标签: it 分类: 转发 1.用JAVA自带的函数 public static boolea ...

  8. JAVA判断32位还是64位,调用不同的DLL(转)

    源:JAVA判断32位还是64位,调用不同的DLL 通过获取sun.arch.data.model可判断是32还是64的JAVA 将32或者64位的DLL放不同的目录,实现自适应调用DLL Prope ...

  9. java判断是否为汉字

    java判断是否为汉字   public static boolean isChinese(String str) { String regEx = "[\u4e00-\u9fa5]&quo ...

随机推荐

  1. Springboot- Caused by: org.hibernate.AnnotationException: No identifier specified for entity:

    错误与异常: Caused by: org.hibernate.AnnotationException: No identifier specified for entity: 原因:引用了不对的包, ...

  2. SARG

    SARG (Searchable Arguments)操作,因为它通常是指一个特定的匹配,一个值得范围内的匹配或者两个以上条件的AND连接.   中文名 SARG 全    称 Searchable ...

  3. LINQ(数据查询)

    如果只有空的构造函数,想要对字段进行初始化,可以直接在构造函数后面加上{属性名=值,属性名=值};属性与属性之间用,分割开 //查询所有武学级别大于8的武林高手 //var res = new Lis ...

  4. UML用例建模解析(二)---------用例执行者之间关系

    (1) 关联关系 关联关系是指执行者与用例之间的关系,又称为通信关系,如果某个执行者可以对某个用例进行操作,它们之间就具有关联关系,如下图所示,“经理”有一个功能为“查看库存报表”,因此可以在执行者“ ...

  5. Ajax-快速上手前后端交互

    Ajax 在之前自己也有总结过关于Ajax的笔记,各种的懵圈,通过一次项目和几次的总结和分享,我对Ajax终于算是有了一定的理解和自己的见解.相信大家见过和度过了很多的关于Ajax的什么前世今生.大刀 ...

  6. scrum meeting 1st

    现状分析 这是一个新项目,在之前的阶段中,基本完成了用户需求分析,在具体实现方面,团队大部分处于初学阶段,需要时间学习试验,预计刚开始项目进展较慢,alpha阶段时间相对紧迫,打算先实现网站的基本功能 ...

  7. cocos2d-html5 中的性能优化

    游戏开发中,难免会遇到性能瓶颈.图片一多,渲染批次就会直线上升,任何动画都会变得闪动. OpenGL ES优化的问题,主要考虑两个方面:内存存储和运行速度. 2D游戏中的最占内存的就是图片资源,一张图 ...

  8. 如果两个人,两台电脑同时登录同一个帐号,同时对同一个账单提交,账单同时被服务器处理,那服务器应该先处理谁的,或者怎么规避这个问题。 非单点登录,重定向,stoken拦截器的问题

    方法一:给用户设置个状态 服务器端坐标记,比如数据库中增加一列,标识是否登陆,登录时先判断这个就行了,不过要考虑非正常退出的情况 http 方法二:在用户表里面 多加一个状态字段,登录成功 改变状态  ...

  9. 电话圈(floyd)

    题意: 如果两个人相互打电话,则说他们在同一个电话圈里.例如,a打给b,b打给c,c打给d,d打给a,则这4个人在同一个圈里:如果e打给f但f不打给e,则不能推出e和f在同一个电话圈里,输出所有电话圈 ...

  10. java实现sendemail

    <dependency> <groupId>com.sun.mail</groupId> <artifactId>javax.mail</arti ...