码迷,mamicode.com
首页 >  
搜索关键字:equals == 对象比较    ( 4743个结果
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
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中equals和==的区别
java中的数据类型,可分为两类: 1.基本数据类型,也称原始数据类型。byte,short,char,int,long,float,double,boolean 他们之间的比较,应用双等号(==),比较的是他们的值。2.复合数据类型(类) 当他们用(==)进行比较的时候,比较的是他们在内存中的存放...
分类:编程语言   时间:2014-06-06 16:43:09    阅读次数:350
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
java-判断相同和对象比较大小
java中判断相同有两种方式: 第一种:使用==直接判断相同,它适用于两个变量之间、一个变量和一个对象之间相比较。 如: int a=3,c=3; Integer b=new Integer(3); System.out.println(a==c); System.out.println(a==b);输出结果为: true true 第二种:使用equals()函数比较,它适用于两个对...
分类:编程语言   时间:2014-06-02 04:58:41    阅读次数:252
junit4的几个assert方法
在静态类junit.framework.Assert或者静态类org.junit.Assert中存在以下几个方法 1.assertEquals()方法,用来查看对象中存的值是否是期待的值,与字符串比较中使用的equals()方法类似; 2.assertFalse()和assertTrue()方法,用来查看变量是是否为false或true,如果assertFalse()查看的变量的值是fal...
分类:其他好文   时间:2014-06-01 14:08:42    阅读次数:259
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!