父类: public class Parent { //看这里的this指的是什么 public Parent() { this.say(); } protected void say() { System.out.println("father"); } } 子类: public class Su ...
分类:
其他好文 时间:
2020-11-21 12:40:44
阅读次数:
24
方法一: import org.json.*; //获取响应状态码 String code = prev.getResponseCode(); System.out.println("code的值:" + code); if (code.equals("${my_code}")) { //获取上一个 ...
分类:
系统相关 时间:
2020-11-21 12:28:24
阅读次数:
13
创建: 2020/11/16 简介 运行环境(runtime)相关 静态变量 in InputStream的指针 out PrintStream的指针 实例方法 println print err PrintStream的指针 静态方法 void exit(int code) 0为正常 long c ...
分类:
编程语言 时间:
2020-11-20 12:15:26
阅读次数:
10
标准方式: import ( "fmt" )使用:fmt.Println() 点(.)方式 import ( . "fmt" ) 使用时候,可以胜率fmt前缀Println() 别名 import( f "fmt" ) 使用方法:f是fmt的简称 f.Println() 下划线(_) import( ...
分类:
其他好文 时间:
2020-11-20 12:07:05
阅读次数:
10
i在式子中参与运算一次就自加1 2+(i)+i+1=6 public static void main(String[] args) { int a = 10; int b = 20; change(c,b); System.out.println(c);// a = 10 System.out.p ...
分类:
其他好文 时间:
2020-11-19 12:20:48
阅读次数:
4
// FileName: HelloWorld.java public class HelloWorld { // Java 入口程序,程序从此入口 public static void main(String[] args) { System.out.println("Hello,World!") ...
分类:
其他好文 时间:
2020-11-13 12:48:52
阅读次数:
5
重载(overloading)(编译期间) 函数或者方法,同名不同参。 在运行的时候,根据引用变量所指向的实际对象的类型来调用方法 主要出现于构造函数,重载体现在一个类中。 public class Overload { public void test(){ System.out.println( ...
分类:
其他好文 时间:
2020-11-10 10:41:52
阅读次数:
4
在Eclipse里试一下,以下代码的输出是多少? double a = 19 * 3.3 ; System.out.println("a: " + a); 为什么结果不是 62.7 ? 显示的结果为 62.699999999999996 ,而不是 62.7 ,为什么? (1) 62.7 和 62.6 ...
分类:
其他好文 时间:
2020-11-07 16:43:55
阅读次数:
27
1.随便新建一个文件夹, 存放代码 2.新建一个Java文件 文件后缀名为.java Hello.java [注意点] 系统可能没有显示文件后缀名, 我们需要手动打开 3.编写代码 public class HelloWorld {//类 类名 //IDEA中打psvm+回车 public stat ...
分类:
其他好文 时间:
2020-11-06 02:21:45
阅读次数:
25
1.A类的代码 public class A { public int a; public A() { System.out.println("默认方法A"); } } 2.B类的代码 public class B extends A{ public int b; public B(int b) { ...
分类:
编程语言 时间:
2020-10-26 10:59:05
阅读次数:
26