让文本框只能输入数字(兼容IE火狐)
2015-10-19 15:18
387 查看
如下面代码:
输出如下:
public class StringTest2 { String s1 = "H"; String s2 = "ello"; String s3 = s1 + s2; String s4 = "H" + "ello"; static String ss1 = "H"; static String ss2 = "ello"; static String ss3 = ss1 + ss2; static String ss4 = "H" + "ello"; final String fs1 = "H"; final String fs2 = "ello"; final String fs3 = fs1 + fs2; final String fs4 = "H" + "ello"; static final String sfs1 = "H"; static final String sfs2 = "ello"; static final String sfs3 = sfs1 + sfs2; static final String sfs4 = "H" + "ello"; public static void main(String[] args) { StringTest2 st = new StringTest2(); st.test1(); } public void test1() { String str1 = "H"; String str2 = "ello"; String str3 = "Hello"; String str4 = str1 + str2; String str5 = "H" + "ello"; //1 System.out.println(str3 == str4); System.out.println(str3 == str5); //2 System.out.println(); System.out.println(str3 == s3); System.out.println(str3 == s4); //3 System.out.println(); System.out.println(str3 == ss3); System.out.println(str3 == ss4); //4 System.out.println(); System.out.println(str3 == fs3); System.out.println(str3 == fs4); //5 System.out.println(); System.out.println(str3 == sfs3); System.out.println(str3 == sfs4); } }
输出如下:
false true false true false true true true true true
相关文章推荐
- ARM体系结构
- NOIP2004虫食算
- C/C++文件操作
- linux下实时查看tomcat运行日志
- 完美实现同时分享图片和文字(Intent.ACTION_SEND)
- vs2003一查找就卡死了
- hadoop1.2.1配置文件
- 在CentOS 7/6.5/6.4 中安装Java JDK
- AngularJS 异常处理
- 我们的钱就这样轻易的让外国赚走了?
- int,long,long long的数据范围
- Mysql 分页语句Limit用法
- CentOS6/7下安装PHP5.6
- SSL和TLS 相关知识(转)
- Jury Compromise
- WKWebView UIWebView
- IOS开发:xib和storyboard的混用
- JDK并发数据结构
- OS X 上如何安装 Ruby 开发环境
- PMAC运动程序例程(一)