随笔分类 -  动手动脑

摘要:一、题目 二、源代码 import java.util.*; public class CountClass { private static int N=0; CountClass(){ N++; } public void print() { System.out.println("已经创建了" 阅读全文
posted @ 2019-10-14 21:47 酸奶面包 阅读(86) 评论(0) 推荐(0)
摘要:一、题目 二、源代码 public class test { public static void fun(test A) { A.print(); } public void print() { System.out.println("访问成功!!!"); } public static void 阅读全文
posted @ 2019-10-14 21:34 酸奶面包 阅读(114) 评论(0) 推荐(0)
摘要:一、题目 二、源代码 public class Setup { public int value=300; public test() { value=200; } { value=100; } public void print() { System.out.println(value); } p 阅读全文
posted @ 2019-10-14 20:55 酸奶面包 阅读(127) 评论(0) 推荐(0)
摘要:一、构建方法 (1)题目 (2)源代码 import java.util.Scanner; public class test { public static void main(String[] args) { Foo obj1=new Foo(); } } class Foo{ int valu 阅读全文
posted @ 2019-10-14 20:51 酸奶面包 阅读(68) 评论(0) 推荐(0)
摘要:一、MethodOverload (1)题目 (2)源代码 // MethodOverload.java // Using overloaded methods public class MethodOverload { public static void main(String[] args) 阅读全文
posted @ 2019-09-23 22:50 酸奶面包 阅读(115) 评论(0) 推荐(0)
摘要:一、枚举类型 (1)题目 (2)源代码 1 public class EnumTest { 2 3 public static void main(String[] args) { 4 Size s=Size.SMALL; 5 Size t=Size.LARGE; 6 //s和t引用同一个对象? 7 阅读全文
posted @ 2019-09-16 20:40 酸奶面包 阅读(137) 评论(0) 推荐(0)