06 2023 档案
摘要:1.编写一个程序,实现从命令行参数输入两 个字符串类型的数值,并计算输出两个数值的 和。 [必做题] package xhy; import java.util.Scanner; public class Text { public static void main(String[] args) {
阅读全文
摘要:1 package xhy; import java.util.Scanner; public interface Fruit{ } class Apple implements Fruit{ public Apple() { System.out.println("创建了一个苹果对象"); } }
阅读全文
摘要:1. 设计三个类,分别如下:(知识点:抽象类及抽象方法) [必做题]• 3.1 设计Shape表示图形类,有面积属性area、周长属性per,颜色属性color,有两个构造方法(一个是默认的、一个是为颜色赋值的),还有3个抽象方法,分别是:getArea计算面积、getPer计算周长、showAll
阅读全文
摘要:1. package xhy; public class Point { public static class Point{ int x; int y; public Point(int x0, int y0) { super(); this.x=x0; this.y=y0; } public P
阅读全文
摘要:1.编写一个方法,实现冒泡排序(由小到大),并调用该方法 package xhy; import java.util.Scanner; public class Text { public static void main(String[] args) { // TODO Auto-generate
阅读全文