五种基本对象类型
字符串(string)
使用’’或” ”括起来
整数(integer)
十进制:123, 八进制:025, 十六进制0x15
浮点数(float)
2.13, 2., .21, 2.1E1
布尔数(boolean)
True, False
复数(complex)
1+2j
通过type()可查看对象类型。
type(2)...
分类:
编程语言 时间:
2015-02-19 12:56:04
阅读次数:
222
chapter2 and 3: 使用Python IDE来交互式地测试表达式 编写Python程序并且从IDE运行,或者从命令行运行 导入模块及调用它们的函数 声明函数以及doc string、局部变量和适当的缩进的使用 定义dictionary、tuple和list 任意一个对象的访问...
分类:
编程语言 时间:
2015-02-19 11:48:37
阅读次数:
215
今天突然想自己写下冒泡排序,没想到憋了半天都没想出来,原来很多看似简单的东西,自己不参照别的挺难出来的。最后还是想出来了贴出代码记录下来:package com.baidu.wwwpublic class Bubble { public static void main(String[] ar...
分类:
编程语言 时间:
2015-02-19 00:16:52
阅读次数:
341
首先是,String,StringBuffer的区别两者的主要却别有两方面,第一是线程安全方面,第二是效率方面线程安全方面:String 不是线程安全的,这意味着在不同线程共享一个String的时候,需要先进行同步,否则会出现不同线程获得的值不同的情况,即线程不安全StringBuffer 是线程安...
分类:
编程语言 时间:
2015-02-18 22:04:57
阅读次数:
285
一.使用系统分享 public void execShare(Activity context,String title,String text){ Intent intent = new Intent(Intent.ACTION_SEND); intent.setType("text/plai.....
分类:
移动开发 时间:
2015-02-18 19:52:21
阅读次数:
335
Problem Description
One day, sailormoon girls are so delighted that they intend to research about palindromic strings. Operation contains two steps:
First step: girls will write a long string (only c...
分类:
其他好文 时间:
2015-02-18 17:40:37
阅读次数:
660
5.1 java8增强的包装类
自动装箱(Autoboxing)和自动拆箱(AutoUnboxing)功能package code;
public class AutoBoxUnboxing{
public static void main(String [] args){
//直接把一个基本类型变量赋给Integer对象
Integer inObj...
分类:
其他好文 时间:
2015-02-18 16:29:16
阅读次数:
145
1.使用func声明一个函数。调用函数使用他的名字加上小括号中的参数列表。使用->分隔参数的名字和返回值类型func greet(name: String, day: String) -> String {return "Hello \(name), today is \(day)."}greet(...
分类:
编程语言 时间:
2015-02-18 16:25:55
阅读次数:
190
/**
* 水仙花数
*/
import java.util.*;
public class acm2010{
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
while(in.hasNextInt()){
int firstNum ...
分类:
其他好文 时间:
2015-02-18 14:08:42
阅读次数:
186
1 class Solution { 2 public: 3 int strStr(char *haystack, char *needle) { 4 5 int i = 0 , skip[256]; 6 char *str = haystack, *substr = n...
分类:
其他好文 时间:
2015-02-18 14:05:12
阅读次数:
149