- 博客(4)
- 收藏
- 关注
原创 2021-02-07
java初学项目----客户信息管理软件(仅内存,不涉及数据库) 来源:bilibili尚硅谷 自整理 第一步 软件结构设计 该软件有以下三个模块组成—— CustomerView CustomerList Customer CustomerView为主模块,负责菜单的显示和处理用户操作 CustomerList为Customer对象的管理模块,内部用数组管理一组Customer对象,并提供相应的添加、修改、删除和遍历方法,供CustomerView调用 Custom
2021-02-07 17:38:33
75
原创 2021-02-04
添加必要的构造器,综合应用构造器的重载,this关键字。 this — 当前对象 第一个java源代码文件 public class Boy{ private String name; private int age; public Boy(){ //三个构造器 } public Boy(String name){ this.name=name; } public Boy(String name,int age){ this.name=name; this.age=age; } publ
2021-02-04 10:43:10
186
原创 构造器(构造方法)
题目:编写两个类:TriAngle和TriAngleTest,其中TriAngle类中声明私有的底边长base和高height,同时声明公共方法访问私有变量。此外,提供类必要的构造器。另一个类中使用这些公共方法,计算三角形的面积。 回答: public class TriAngleTest(){ Triangle s=new Triangle(); //无参对象通过get,set方法赋给私有属性值 s.setBase(5); s.setHeight(3); int area1=s.getBase() *
2021-01-21 23:05:42
263
原创 java初学有趣网红面试题
第一题 public class Test{ public static void main(String[] args){ int a=10; int b=10; method(a,b);//需要在method方法被调用之后,仅打印出a=100,b=200,请写出method方法的代码 System.out.println(“a=”+a); System.out.println(“b=”+b); } } 第一题答案 public static void main(int a,int b){ a=a10;
2021-01-20 22:51:34
251
5
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人