码迷,mamicode.com
首页 >  
搜索关键字:println    ( 5792个结果
Java中,如何让System.out.printf("%d", 2 + 2);输出5
代码如下: import java.lang.reflect.Field; public class TwoPlusTwo { public static void main(String[] args) throws Exception { Class cache = Integer.class.getDeclaredClasses()[0]; System.out.println...
分类:编程语言   时间:2014-11-17 17:47:40    阅读次数:256
Swift 中的静态方法继承
Base and Derived Classes:class BaseClass{ class func staticMethod(){ println("BaseClass.staticMethod") } class func staticMethodWi...
分类:编程语言   时间:2014-11-17 13:56:04    阅读次数:182
Swift 字符串和字符
swift中的字符串和字符都兼容unicode定义一个字符串let hello="hello world"初始化一个空的字符串let hello=""let hello=String()判断一个字符串是否为空if hello.isEmpty{println("这是个空字符串")}字符串可以使用+进行...
分类:编程语言   时间:2014-11-16 13:15:20    阅读次数:241
Swift 基础
1.hello worldswift中的helloworld十分简单 println("hello world")即可完成hello world2.变量 常量swift的变量使用var关键字,常量使用let关键字比如:let max=10 // swift 一个语句结束可以不需要分号var logi...
分类:编程语言   时间:2014-11-15 21:41:07    阅读次数:240
Go语言类型声明以及转换、默认值
package mainimport( "fmt")type TestInterface interface{}func main(){ a:=65 // char A 's ascii code b:=float64(a) c:=string(a) fmt.Println(a) fmt...
分类:编程语言   时间:2014-11-15 20:03:52    阅读次数:167
java 判断一个字符串是否包含某个字符串中的字符
public static void main(String[] args) { if(isHave("购买ab","出售AssBC"))System.out.println("true"); //返回trueelse System.out.println("false");} // publi.....
分类:编程语言   时间:2014-11-15 11:15:42    阅读次数:179
Scala学习笔记--集合类型
队列Queue val emp = scala.collection.immutable.Queue[Int](); val has1 = emp.enqueue(1) val has123=has1.enqueue(List(2,3)) println(has1) ...
分类:其他好文   时间:2014-11-14 22:25:25    阅读次数:178
111
classsushu { publicstaticvoidmain(String[]args) { System.out.println("HelloWorld!"); //inttp=0; for(intx=2;x<=100;x++) { inttp=0; for(inty=2;y<=x-1;y++) { if(x%y==0) { tp=1; break; } } if(tp==0) ..
分类:其他好文   时间:2014-11-14 01:46:59    阅读次数:176
object的hashCode与equals
JAVA代码: public static void main(String[] args) { Object obj1 = new Object(); Object obj2= new Object(); Object obj3 = obj2; System.out.println("ob...
分类:其他好文   时间:2014-11-14 01:28:09    阅读次数:118
常用位操作技巧(Golang)
1,判断奇偶 for?i?:=?0;?i?<?100;?i++?{ ????if?i?%?2?==?0?{ ????????println(i) ????} ????if?i?&?0x1?==?0?{ ????????println(i) ????} } 2,交换两个数...
分类:其他好文   时间:2014-11-14 00:22:49    阅读次数:206
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!