码迷,mamicode.com
首页 >  
搜索关键字:equals    ( 4544个结果
java防止sql注入
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
Java中==和equals区别详解
首先来说下两种比较符的使用场景: 1、==是一般用来比较值类型,比较两个数据类型的值是否相等,例如:byte,shot,char,int,long,float,double,boolean,值类型(还有对象引用)一般存储在内存的栈中 2、equals用来比较复合数据类型,复合数据类型的变量在栈中存储的是引用类型变量的地址,本身存储在堆中。 当使用==比较复合数据类型时,比较的是他们在内存中的地...
分类:编程语言   时间:2015-05-04 15:38:45    阅读次数:188
[LeetCode] Path Sum
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
UVA - 10483 The Sum Equals the Product 暴力
题目大意:给出一个范围,要求找出这个范围内满足 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
java基础入门-hashcode与equils方法
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
Leetcode#112Path Sum
Givenabinarytreeandasum,determineifthetreehasaroot-to-leafpathsuchthataddingupallthevaluesalongthepathequalsthegivensum.Forexample:Giventhebelowbinarytreeandsum=22,5 /48 //11134 /\721returntrue,asthereexistaroot-to-leafpath5->4->11->2whichsum..
分类:其他好文   时间:2015-04-30 20:22:50    阅读次数:100
java中equals和“==”的差别
==操作比较的是两个变量的值是否相等 equals操作表示的两个变量是否是对同一个对象的引用比如代码如下: String a = "1c11"; String b = "1c11"; if(a == b) { System.out.println("true1"); } Strin...
分类:编程语言   时间:2015-04-30 18:25:33    阅读次数:127
详解equals和==的区别
对于字符串变量: 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
js中的总结汇总(以后的都收集到这篇)
点1:js中的比较字符串是否相等,js中是用"=="这个来判断是否相等,这点跟java中不一样,java中是.equals()这种方法。 在之前写的ajax的demo中,因为用了.equals()来比较两个密码是否相等,找了好久都没找到原因。所以切记js中是用“==”,而不是.equals()...
分类:Web程序   时间:2015-04-29 00:28:23    阅读次数:172
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!