摘要: 1 package Pro1; 2 3 public class Test { 4 public static void main(String[] args) { 5 String str = "Hello World"; 6 char[] c = str.toCharArray(); 7 Str 阅读全文
posted @ 2020-05-25 09:55 ahuhah 阅读(91) 评论(0) 推荐(0) 编辑
摘要: package lianxi; /*2、设计四个类,分别是:(知识点:抽象类及抽象方法) (1)Shape表示图形类,有面积属性area、周长属性per,颜色属性color,有两个构造方法(一个是默认的、一个是为颜色赋值的),还有3个抽象方法,分别是:getArea计算面积、getPer计算周长、s 阅读全文
posted @ 2020-05-21 13:36 ahuhah 阅读(158) 评论(0) 推荐(0) 编辑
摘要: package cola; public class colaEmployee { String name; int month; public colaEmployee() { } public colaEmployee(String name, int month) { super(); thi 阅读全文
posted @ 2020-05-20 10:52 ahuhah 阅读(106) 评论(0) 推荐(0) 编辑
摘要: 1. //1、(1)定义一个汽车类Vehicle,要求如下:(知识点:类的继承 方法的覆盖)(a)属性包括:汽车品牌brand(String类型)、颜色color(String类型)和速度speed(double类型)。(b)至少提供一个有参的构造方法(要求品牌和颜色可以初始化为任意值,但速度的初始 阅读全文
posted @ 2020-05-14 13:22 ahuhah 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 1. package jv;public class zuoye { String name = new String("该学生未命名"); double a; public Student() { } public Student(String b, double y) { this.name = 阅读全文
posted @ 2020-05-07 13:33 ahuhah 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 1. package jv;public class zuoye { int x; int y; Point() { } Point(int x0, int y0) { this.x = x0; this.y = y0; } public void movePoint(int dx, int dy) 阅读全文
posted @ 2020-04-30 12:15 ahuhah 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 1. package zuoye;public class sj { private String color; private int cpu; public laptop(String color,int cpu) { this.color =color; this.cpu=cpu; } pub 阅读全文
posted @ 2020-04-23 13:49 ahuhah 阅读(93) 评论(0) 推荐(0) 编辑
摘要: 1 定义三个方法:getArea()求面积、getPer()求周长,showAll()分别在控制台输出长、宽、面积、周长。2 有2个属性:长length、宽width3 创建一个Rectangle对象,并输出相关信息 package sss;public zuoye { double length; 阅读全文
posted @ 2020-04-23 10:46 ahuhah 阅读(89) 评论(0) 推荐(0) 编辑
摘要: 1. package sj;import java.util.*;public class zy { public static void main(String[] args) { int a[] = new int[10]; int sum = 0, max = 0, min = 1000; S 阅读全文
posted @ 2020-04-16 14:19 ahuhah 阅读(100) 评论(0) 推荐(0) 编辑
摘要: 1. package week; import java.util.Scanner; public class zy { public static void main(String[] args) { // TODO Auto-generated method stub int[] num = n 阅读全文
posted @ 2020-04-15 15:09 ahuhah 阅读(138) 评论(0) 推荐(0) 编辑