public final static String filterSQLInjection(String s) { ??? if (s == null || "".equals(s)) { ??????? return ""; ??? } ??? try { ??????? s = s.trim().replaceAll("</?[s,S][c,...
分类:
数据库 时间:
2015-05-04 18:26:03
阅读次数:
151
首先来说下两种比较符的使用场景:
1、==是一般用来比较值类型,比较两个数据类型的值是否相等,例如:byte,shot,char,int,long,float,double,boolean,值类型(还有对象引用)一般存储在内存的栈中
2、equals用来比较复合数据类型,复合数据类型的变量在栈中存储的是引用类型变量的地址,本身存储在堆中。
当使用==比较复合数据类型时,比较的是他们在内存中的地...
分类:
编程语言 时间:
2015-05-04 15:38:45
阅读次数:
188
Path Sum
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.
For example:
Given the below bina...
分类:
其他好文 时间:
2015-05-04 15:30:49
阅读次数:
113
<% DBHelperdb=DBHelper.getInstance(); Longsid=Common.getLong(SessionTools.currentWebsite(request).get("id")); Mapobj=newHashMap(); //获取当前页 StringcatId=Common.getString(request,"catId",true); MapnewObj=newHashMap(); if(catId==null||"".equals(catId)..
分类:
其他好文 时间:
2015-05-04 10:16:38
阅读次数:
129
题目大意:给出一个范围,要求找出这个范围内满足
n = x + y + z = x * y * z的所有式子解题思路:因为这里的小数位精确到了0.01,所以先讲x,y,z都相应放大100倍
从小到大枚举,假设x <= y <= z,那么x的范围就在 (0,n ^(1/3)],y的范围就在[x,(n-x)^(1/2)]这样范围就可以确定下来了
而z又可以通过x和y得到
因为x + y + z...
分类:
其他好文 时间:
2015-05-03 16:02:19
阅读次数:
106
equils方法的特性:
1.自反性,对于任何非空引用x,x.equils(x)返回true
2.对称性,对于任何引用x,y,x.equils(y)返回true,那么y.equils(x)返回true
3.传递性,...
分类:
编程语言 时间:
2015-05-03 10:42:39
阅读次数:
198
Givenabinarytreeandasum,determineifthetreehasaroot-to-leafpathsuchthataddingupallthevaluesalongthepathequalsthegivensum.Forexample:Giventhebelowbinarytreeandsum=22,5
/48
//11134
/\721returntrue,asthereexistaroot-to-leafpath5->4->11->2whichsum..
分类:
其他好文 时间:
2015-04-30 20:22:50
阅读次数:
100
==操作比较的是两个变量的值是否相等
equals操作表示的两个变量是否是对同一个对象的引用比如代码如下: String a = "1c11";
String b = "1c11";
if(a == b)
{
System.out.println("true1");
}
Strin...
分类:
编程语言 时间:
2015-04-30 18:25:33
阅读次数:
127
对于字符串变量:
1、如果使用的类重写了equals()方法,那么equals()比较的是字符串中包含的内容是否相同,否则equals()和==一样比较的是内存地址;
2、==始终比较的是两个变量的内存地址;public class Test1 {
public static void main(String[] args) {
String s1,s2,s3="abc",s4="abc...
分类:
其他好文 时间:
2015-04-29 13:34:34
阅读次数:
145
点1:js中的比较字符串是否相等,js中是用"=="这个来判断是否相等,这点跟java中不一样,java中是.equals()这种方法。 在之前写的ajax的demo中,因为用了.equals()来比较两个密码是否相等,找了好久都没找到原因。所以切记js中是用“==”,而不是.equals()...
分类:
Web程序 时间:
2015-04-29 00:28:23
阅读次数:
172