file ,err :=os.Open("d:\\aaa.txt") // 打开文件句柄 if err!=nil{ fmt.Println("打开文件出错") }else { fmt.Println("文件存在") } read := bufio.NewReader(file) // 创建文件读取对 ...
分类:
其他好文 时间:
2020-07-13 13:26:03
阅读次数:
97
通用编程概念 变量、基本类型、函数、控制流 变量与可变性 rust中的变量默认是不可变的,这样是为了能够让你安全并且方便地写出复杂、甚至并行的代码。 当一个变量是不可变时,一旦它绑定到了某个值上面,这个值就再也无法被改变了。 1 let x = 5;m, 2 println!("The value ...
分类:
其他好文 时间:
2020-07-13 09:25:50
阅读次数:
71
@Test public void test1(){ File file1 = new File("/Users/truman/Desktop/Life"); System.out.println(file1); System.out.println(file1.isDirectory()); Fi ...
分类:
编程语言 时间:
2020-07-12 12:26:01
阅读次数:
67
package main import ( "fmt" ) func main() { a := 1 b := 2 defer func() { err := recover() //recover只能放在defer之后使用 fmt.Println(err) }() //匿名函数 swap(a, b ...
分类:
其他好文 时间:
2020-07-12 01:17:27
阅读次数:
88
// cadence = 0 是表达式 int cadence = 0; // anArray[0] = 100 是表达式 anArray[0] = 100; // "Element 1 at index 0: " + anArray[0] 是表达式 System.out.println("Elem ...
分类:
移动开发 时间:
2020-07-11 23:05:59
阅读次数:
246
package main import ( "crypto/md5" "fmt" "io" ) func main() { // 第一种 var str = "golang" slice := []byte(str) res := md5.Sum(slice) fmt.Println(res) // ...
分类:
其他好文 时间:
2020-07-11 09:58:03
阅读次数:
83
1 /** 2 * @author jliu.l 3 * @2020年7月7日 4 * 5 */ 6 public class Calendar { 7 8 public static void main(String[] args) { 9 System.out.println(" 万年历 "); ...
分类:
其他好文 时间:
2020-07-10 16:49:45
阅读次数:
145
给定一个字符串 S 和一个字符串 T,请在 S 中找出包含 T 所有字母的最小子串? 输入: S = "ADOBECODEBANC", T = "ABC" 输出: "BANC" public static void main(String[] args) { System.out.println(t ...
分类:
编程语言 时间:
2020-07-10 11:40:17
阅读次数:
74
1 public class Text { 2 3 public static void main(String args[] ){ 4 float x=123.45; 5 System.out.println(x); 6 } 7 } 不加F默认是double类型,取值范围从大范围(double)向 ...
分类:
编程语言 时间:
2020-07-08 23:01:40
阅读次数:
83
public class digui { /* * 需求:从键盘接收一个文件夹路径,统计该文件夹大小 * */ public static void main(String[] args) { File dir = getDir(); System.out.println(getFileLength ...
分类:
其他好文 时间:
2020-07-08 22:41:02
阅读次数:
56