
jase
enight0000
这个作者很懒,什么都没留下…
展开
-
java2--接口和链表【例】
宠物商店//接口的使用,类的封装,链表//2012.7.25interface Pet{ //宠物前台 public String getName() ; public String getAge(); public String getColor(); public String getCategory(); //抽象方法--宠物类别};abstract class原创 2012-08-09 17:10:47 · 436 阅读 · 0 评论 -
java错误: Must qualify the allocation with an enclosing instance of type
错误:No enclosing instance of type Test1 is accessible. Must qualify the allocation with an enclosing instance of type Test1 (e.g. x.new A() where x is an instance of Test1).代码:public class Test1原创 2012-11-10 17:25:45 · 3251 阅读 · 0 评论 -
java2--TCP最简单的应用【例】
TCP//tcp协议链接//2012.8.9import java.net.*;import java.io.*;public class ServerDemo { public static void main(String args[])throws Exception{ ServerSocket server = null; //服务端 Socket cli原创 2012-08-09 17:22:24 · 372 阅读 · 0 评论 -
java2--反射【例】
反射的学习package xzx.getandset;import java.lang.reflect.Constructor;import java.lang.reflect.Modifier;public class GetAndSetDemo{ public static void main(String args[]){ Class cls = null; Person原创 2012-08-09 17:21:08 · 367 阅读 · 0 评论 -
java2--泛型的简单例子【例】
interface Info{};class Introduction implements Info{ String name; String age; String sex; public Introduction(String name,String age,String sex){ this.name = name; this.age = age; this.sex原创 2012-08-09 17:15:02 · 343 阅读 · 0 评论 -
java2--文件io流操作【例】
字节流//2012.8.9//IO流操作import java.io.*;public class IoDemo{ public static void main(String args[]){ OutputStream out = null; //输出流 InputStream in = null; //输入流 //目录 String locket = "g:" +原创 2012-08-09 17:28:17 · 554 阅读 · 0 评论 -
java2--二叉树【例】
二叉树的实例//2012.7.29//二叉树class Student implements Comparable{ int score; String name; public Student(String name,int score){ this.name = name; this.score = score ; } public int compare原创 2012-08-09 17:17:59 · 343 阅读 · 0 评论 -
java2-链表【例】
实现链表操作//链表//2012.7.25class DoIt{ class Node{ private String data; private Node next; public void setNext(Node next){ this.next = next; } public Node getNext(){ return this原创 2012-08-09 17:07:23 · 376 阅读 · 0 评论 -
java2--类的封装【例】
//类的封装//主要是完成login In登录验证 //2012.7.24class Check{ public boolean check(String name,String password){ if(name.equals("xxxx")&&password.equals("0000")){ return true; }else{ return false原创 2012-08-09 17:03:29 · 345 阅读 · 0 评论 -
java2--里氏代换原则【例】
实现一个咖啡厅的点单系统 一杯咖啡+各种调料使用面向对象的方法编程,并遵循开闭原则//2012.8.1//咖啡厅点单系统public abstract class Beverage{ //咖啡的抽象类 String name = "unknow"; String description = "unknow"; public String g原创 2012-08-09 17:44:06 · 458 阅读 · 0 评论