创建hello.java文件, 输入: public class hello { public static void main(String[] args) { System.out.println("hello, world!"); } } 在hello.java所有的directory中, 打 ...
分类:
编程语言 时间:
2020-05-09 23:05:26
阅读次数:
126
这是一个很常见的现象,不知道大家有没有注意到,直接上代码 大家想想以下代码的运行情况会是什么 public class Main { static int a; public static void main(String[] args) { int b; System.out.println(a) ...
分类:
编程语言 时间:
2020-05-08 13:22:03
阅读次数:
81
将ArrayList中的元素按照给定字符拼接起来 public static void main(String[] args) { List<String> list = Arrays.asList("nice","to","meet","you"); System.out.println(list ...
分类:
编程语言 时间:
2020-05-07 00:34:55
阅读次数:
81
数字具体的和 public static void main(String[] args) { while (true) { System.out.println("请输入一个数字"); Scanner sc = new Scanner(System.in); long b = sc.nextLon ...
分类:
其他好文 时间:
2020-05-06 12:26:05
阅读次数:
65
1、下面回车 psvm public static void main(String[] args){} sout System.out.println(); 2、写完,就即时保存了,不需要按ctrl+s 3、写完代码,就编译好了,直接运行即可 ...
分类:
其他好文 时间:
2020-05-06 01:49:39
阅读次数:
68
1 package test_2_2; 2 3 public class Cycle { 4 5 public void balance() { 6 7 System.out.println("this is Cycle.balance()"); 8 } 9 } 1 package test_2_2 ...
分类:
编程语言 时间:
2020-05-05 12:35:03
阅读次数:
57
1 package test_2_1; 2 3 public class Rodent { 4 5 public void eat() { 6 7 System.out.println("Rodent.eat()"); 8 } 9 10 public void run() { 11 12 Syste ...
分类:
编程语言 时间:
2020-05-05 10:34:38
阅读次数:
58
类加载器的双亲委派机制 1)启动类加载器:null(不是由java实现) System.out.println(类名.class.getClassLoader().getParent().getParent()); 启动类加载器加载java核心库(java路径下jre/lib、classes) 2) ...
分类:
编程语言 时间:
2020-05-04 17:45:36
阅读次数:
71
1 package test_1_4; 2 3 public class Amphibian { 4 5 public Amphibian(int i) { 6 7 System.out.println("this is Amphibian"); 8 } 9 10 public void print ...
分类:
编程语言 时间:
2020-05-04 15:05:51
阅读次数:
57
学习自耗子叔 简单几个例子 package main import "fmt" func decorator(f func(s string)) func(s string) { return func(s string) { fmt.Println("started") f(s) fmt.Prin ...
分类:
其他好文 时间:
2020-05-04 13:41:45
阅读次数:
79