随笔分类 - 每日系列
摘要:1 package t1; 2 import javax.swing.*; 3 public class Test5 extends JFrame { 4 JTextField jtf=new JTextField("该文本框不可编辑",30); 5 static JPasswordField jp
阅读全文
摘要:1 import javax.swing.*; 2 public class Test2 extends JFrame { 3 4 public static void main(String[] args) { 5 6 Test2 jfrm=new Test2(); 7 ImageIcon ic=
阅读全文
摘要:1 package t1; 2 import javax.swing.*; 3 import java.awt.*; 4 import javax.swing.border.TitledBorder; 5 public class Test1 { 6 7 public static void mai
阅读全文
摘要:我回来了,兄弟们,以后稳定每日一更哈。废话不多说,直接上码。 1 class MyThread extends Thread { 2 private String who; 3 public MyThread(String str) { 4 who=str; 5 } 6 public void ru
阅读全文
摘要:1 abstract class OutputAlphabet { 2 public abstract void output(); 3 } 4 class OutputEnglish extends OutputAlphabet { 5 public void output() { 6 for(c
阅读全文
摘要:1 class RedCowForm { 2 static String formName; 3 RedCow cow; //内部类声明对象 4 RedCowForm() {} //不写对输出结果没有影响 5 RedCowForm(String s) { 6 cow=new RedCow(150,1
阅读全文
摘要:1 abstract class MotorVehicles { 2 abstract void brake(); 3 } 4 interface MoneyFare { 5 void charge(); 6 } 7 interface ControlTemperature { 8 void con
阅读全文
摘要:1 interface Advertisement { 2 public abstract void showAdvertisement(); 3 public abstract String getCorpName(); 4 } 5 class AdvertisementBoard { 6 pub
阅读全文
摘要:1 class School { 2 String name; 3 public class Student { 4 String name; 5 int age; 6 public Student(String schoolName,String studentName,int newAge) {
阅读全文
摘要:1 interface Animal { 2 public abstract void cry(); 3 public abstract String getAnimalName(); 4 } 5 class Simulator { 6 public void playSound(Animal an
阅读全文
摘要:1 class A { 2 double f(double x,double y) { 3 return x+y; 4 } 5 static int g(int n) { 6 return n*n; 7 } 8 } 9 class B extends A { 10 double f(double x
阅读全文
摘要:1 interface Achievement { 2 public abstract float average(); 3 } 4 class Person { 5 String name; 6 int age; 7 public Person(String newName,int newAge)
阅读全文
摘要:1 abstract class SIM { 2 public abstract void setNumber(String n); 3 public abstract String giveNumber(); 4 public abstract String giveCorpName(); 5 }
阅读全文
摘要:1 abstract class Shape { 2 public abstract float area(); 3 public abstract void printArea(); 4 } 5 class Rectangle extends Shape { 6 int width; 7 int
阅读全文
摘要:1 class PersonA { 2 private String name; 3 public void setName(String newName) { 4 name=newName; 5 } 6 public String getName(){ 7 return name; 8 } 9 }
阅读全文
摘要:1 public class Test4_3_5 { 2 public static void main(String[] args) { 3 f(1,2); 4 f(-1,-2,-3,-4); //给参数传值时,实参的个数很灵活 5 f(9,7,6); 6 } 7 public static vo
阅读全文
摘要:1 import java.util.Date; 2 public class Example4_16 { 3 public static void main(String[] args) { 4 Date date=new Date(); 5 System.out.println("本地机器的时间
阅读全文
摘要:1 import java.util.*; 2 public class Example4_11 { 3 public static void main(String[] args) { 4 Scanner scanner=new Scanner(System.in); 5 int[] a={12,
阅读全文
摘要:1 class Cylinder { 2 private double radius; 3 private int height; 4 private double pi=3.14; 5 String color; 6 public Cylinder() { 7 this(2.5,5,"红色");
阅读全文
摘要:1 class Cylinder { 2 private double radius; 3 private int height; 4 private double pi=3.14; 5 private String color; 6 public double setCylinder(double
阅读全文

浙公网安备 33010602011771号