1、==可用于基本类型和引用类型:当用于基本类型时候,是比较值是否相同;当用于引用类型的时候,是比较对象是否相同。
2、对于String a = “a”; Integer b = 1;这种类型的特有对象创建方式,==的时候值是相同的。
3、基本类型没有equals方法,equals只比较值(对象中的内容)是否相同(相同返回true)。
4、一个类如果没有定义equals方法,它将默认继承Object中的equals方法,返回值与==方法相同。...
分类:
编程语言 时间:
2015-01-31 00:34:31
阅读次数:
177
//新建一个HashSetHashSet sixHashSet = new HashSet();//满6位时结束循环 while (sixHashSet.size() != 6) { String temp = Integer.toString((int) (Math.random() * ...
分类:
编程语言 时间:
2015-01-31 00:17:24
阅读次数:
153
上界2147483647-, 下界2147483648. 反过来看7463847412 -> 2147483647, -8463847412 -> -2147483648为使反转不越界,那么绝对值大于10^9的参数x的前9位应满足 2147483647. (参数x,本身没有越界,所以d肯定是1或2....
分类:
其他好文 时间:
2015-01-30 20:54:36
阅读次数:
127
先进行如下操作: from flask import Flask from flask.ext.sqlalchemy import SQLAlchemy app=Flask(__name__) db=SQLAlchemy(app) 一对多: class Parent(db.Model): ??? id=db.Column(db.Integer,primary_...
分类:
数据库 时间:
2015-01-30 17:53:36
阅读次数:
297
Given a roman numeral, convert it to an integer.
Input is guaranteed to be within the range from 1 to 3999.
请参考上一篇博文:http://blog.csdn.net/chenxun_2010/article/details/43274049roman to int:
class...
分类:
其他好文 时间:
2015-01-30 16:11:05
阅读次数:
116
问题是这样子的:Implement atoi to convert a string to an integer.Hint: Carefully consider all possible input cases. If you want a challenge, please do not see...
分类:
其他好文 时间:
2015-01-30 15:08:07
阅读次数:
163
Implementatoito convert a string to an integer.Hint:Carefully consider all possible input cases. If you want a challenge, please do not see below and ...
分类:
其他好文 时间:
2015-01-30 14:37:44
阅读次数:
127
Given a roman numeral, convert it to an integer.
Input is guaranteed to be within the range from 1 to 3999.
这题的做法和前面一体interger to roman 类似 建一个dictionary 去查询。
1.先把string 反转
2. 用一个last去保存上一次的di...
分类:
编程语言 时间:
2015-01-30 10:53:17
阅读次数:
293
Given an integer, convert it to a roman numeral.
Input is guaranteed to be within the range from 1 to 3999.
建两个list依次match 罗马数字。 比较特殊的是 一些有两位的罗马数字。
来自http://www.cnblogs.com/zuoyuan/p/377958...
分类:
编程语言 时间:
2015-01-30 10:51:44
阅读次数:
190
Given an integer, convert it to a roman numeral.
Input is guaranteed to be within the range from 1 to 3999.
罗马数字规则:参考wiki:http://zh.wikipedia.org/wiki/%E7%BD%97%E9%A9%AC%E6%95%B0%E5%AD%97
1,...
分类:
其他好文 时间:
2015-01-30 09:19:22
阅读次数:
196