码迷,mamicode.com
首页 >  
搜索关键字:equals    ( 4544个结果
LeetCode: Path Sum II [113]
【题目】 Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum. For example: Given the below binary tree and sum = 22, 5 / 4 8 / / 11 13 4 ...
分类:其他好文   时间:2014-06-20 10:53:08    阅读次数:181
Swift--基本运算符
这一章相对简单,只对运算符进行简单的举例讲解。 基本运算包括: 一、赋值(=) 例如:  let b = 10  var a = 5 a = b // a is now equal to 10 二、算法(+ - * /) 例如: 1 +2       // equals 3 5 -3       // equals 2 2 *3       // equals 6 10....
分类:其他好文   时间:2014-06-20 09:51:38    阅读次数:237
java:复写equals实例
class User{ String name; int age; /* *比较过程思路: *1、两个对象指向位置相同,那么他们就相等,return后跳出函数,不再往下执行 *2、指向位置不同,有3情况 *a:这两对象类型相同,并且内容相同,也属于相等 ...
分类:编程语言   时间:2014-06-12 00:16:40    阅读次数:344
八、4、Object、内部类
------java.lang.ObjectObject:所有类的直接或者间接父类,Java认为所有的对象都具备一些基本的共性内容,这些内容可以不断的向上抽取,最终就抽取到了一个最顶层的类中的,该类中定义的就是所有对象都具备的功能。具体方法:1,boolean equals(Object obj):...
分类:其他好文   时间:2014-06-11 23:30:32    阅读次数:308
java:比较对象
对象内容相等条件:1、对象类型相同(可用instanceof操作符比较)2、对象的成员变量的值完全相同instanceof 判断对象类型//a是否为Child对象类型boolean b = a instanceof Child;equals用于判断两个变量是否是对同一个对象的引用,即堆中的内容是否相...
分类:编程语言   时间:2014-06-11 23:19:38    阅读次数:233
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 binary t...
分类:其他好文   时间:2014-06-07 15:31:32    阅读次数:179
LeetCode: Path Sum [112]
【题目】 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 binary tree and sum = 22, 5 / ...
分类:其他好文   时间:2014-06-07 13:57:37    阅读次数:210
Path Sum II
题目 Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum. For example: Given the below binary tree and sum = 22, 5 ...
分类:其他好文   时间:2014-06-07 13:47:22    阅读次数:191
java 空字符串与null区别
转自:http://liucun.iteye.com/blog/801691" "分配了内存 ;null没有调用null的字符串的方法会抛空指针异常。""是一个字符串(String).它在内存中是存在的.它可以使用Object对象中的方法(如"".toString();"".equals())而nu...
分类:编程语言   时间:2014-06-06 12:20:27    阅读次数:243
android Snake(3)
添加两个苹果到主界面Coordinate定义坐标,其中有能够判断是否相等的equals方法,用以判断两个坐标是否相等。MyRandom随机数生成类,封装random能够控制随机数产生的范围,产生随机坐标。SnakeView中判断产生的苹果是否重复,如果重复再产生一个,直到不重复为止。Coordina...
分类:移动开发   时间:2014-06-06 08:26:25    阅读次数:385
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!