Date用法 Date datetime = new Date(); //获取当前日期 String date = String.format("%tF", datetime); System.out.println(date); // 2020-03-08 // 获取当前时间 String tim ...
分类:
其他好文 时间:
2020-03-08 19:37:14
阅读次数:
81
一、Demo.javapublic class Demo { //定义一个类 public static void main(String[] args) { //主方法,一切程序的起点 /* 在屏幕上打印输出 */ System.out.println("Hello World!"); }}? p ...
分类:
编程语言 时间:
2020-03-07 16:21:39
阅读次数:
79
package li; public class pupuer { public static void main(String[] args) { // TODO 自动生成的方法存根 System.out.println("Hello world !"); } } ...
分类:
编程语言 时间:
2020-03-07 13:27:22
阅读次数:
58
1、默认使用无参构造的方式,验证下: public class User { private String name; public User(){ System.out.println("这是一个无参构造方法"); } public String getName() { return name; ...
分类:
编程语言 时间:
2020-03-07 13:13:51
阅读次数:
70
package lsiyn; public class Text1 { public static void main(String[] args) { // TODO Auto-generated method stub System.out.println("hello world"); } } ...
分类:
其他好文 时间:
2020-03-07 12:51:28
阅读次数:
62
遍历map1.这是最常见的并且在大多数情况下也是最可取的遍历方式。在键值都需要时使用。Map map = new HashMap(); for (Map.Entry entry : map.entrySet()) { System.out.println("Key = " + entry.getKe... ...
分类:
其他好文 时间:
2020-03-07 12:48:04
阅读次数:
68
文件读写12345678910111213141516171819202122232425262728293031323334func () { fileInfo, err := os.Stat("aaa.txt") if err != nil { fmt.Println("error") retu... ...
分类:
其他好文 时间:
2020-03-07 12:45:39
阅读次数:
77
1 package static类型.执行顺序; 2 3 public class Test { 4 Person person = new Person("Test"); 5 static{ 6 System.out.println("test static");//1 7 } 8 9 publi ...
分类:
编程语言 时间:
2020-03-06 19:57:38
阅读次数:
63
public class iloveyouright{ public static void main(String[] args){ System.out.println("\t*\t\t\t*"); System.out.println("*\t\ti love you\t\t*"); Syst ...
分类:
编程语言 时间:
2020-03-06 15:34:08
阅读次数:
69
public class HelloWorld{//源文件中只能有一类声明为public , 且类名和源文件名得一样 //main方法,程序的入口 public static void main(String [] args){ /* 这是程序的输出语句 */ System.out.println( ...
分类:
编程语言 时间:
2020-03-06 15:08:32
阅读次数:
69