搜索资源列表
String_int
- String int 字符串常量池 包装类型 函数参数 值传递引用传递 的 内存分配例子——源码 代码段: public static void fun_ref (Ref_test ref_out){ Ref_test ref_in=new Ref_test() ref_in.s1="in" //ref_out.s1="out" ref_out=ref_in //漏洞!!ref_out 指向ref_in , //那么当函数退出后,re
thread
- java 线程 静态锁,对象锁, synchronized 是锁方法还是锁对象?还是锁类?如何实现?? 部分代码如下, public static Object lock=new Object() //静态锁,锁类,不是锁对象了!!所以两个线程同时 运行两个 TestThread 的execute( ),也可以同步!!! public void execute(){ // synchronized(lock){ for(int i=0 i<
Thefirstjavaprogram
- 第一个Java程序 public class Practice { public static void main(String args[]) { System.out.println("**********************************") System.out.println("** Practice makes perfect") System.out.println("**************************
java
- 了解Java语言的发展历史和Java平台的应用划分。 了解Java语言的特点及其实际应用领域。 了解Java开发环境及开发工具,掌握如何设置开发环境及如何编译和运行Java程序。 熟悉几种不同类型的Java程序-import java.applet.* import java.awt.* public class FirstApplet extends Applet { public void paint(Graphics g) { g.d
AbstractClassDemo
- 构造函数的重载: 创建一个对象必须用构造方法,构造方法的最主要功能是对创建的对象进行初始化。特点: 方法名同类名; 无返回类型(省去void); 在创建对象时,系统自动调用。 -The overloaded constructor: Create an object constructor must be used, construction methods to create the most important function is to initialize the
HelloWorld1
- class HelloWorld{ public static void main(String[]args){ System.out.println("hello,world!") } }-class HelloWorld{ public static void main(String[]args){ System.out.println("hello,world!") } }
5070409579_8
- 写一个类,利用java提供的反射机制得到用户在程序运行时输入的类名,输出该类所在继承体系中的所有类中定义的方法,所有方法需按字母排序。 比如用户输入java.util.ArrayList,输出为: Methods of class java.util.ArrayList: public void add(int,Object) public boolean add(Object) public boolean addAll(int,Collection) public b
user
- 这个源代码是关于堆栈的应用,堆栈是JAVA 数据应用的一个主要构成部分。-public interface Queue { public void append(Object obj)throws Exception public Object delete()throws Exception public Object getFront()throws Exception public boolean notEmpty()
htmlparser1_5_20050614
- 手动解析HTML是一件很崩溃的事情,sun的swing里也有解析HTML的东东,不过已经是古董了,实在不好拿出来丢Java的人了。-private void extractLinks(URL pageURL, Parser parser) { Map<String, String> links = new HashMap<String, String>() try { NodeFilt
GridBagEx1
- gridbaglayout example-import java.awt.* import java.util.* import java.applet.Applet public class GridBagEx1 extends Applet { protected void makebutton(String name, GridBagLayout gridbag, GridBagConstraints c) { Button butt
SerialDemo
- Serial Communication-package aa import javax.comm.* import java.util.Properties import java.util.Enumeration import org.omg.Dynamic.* import java.awt.Choice public class serialcomm { void listPortChoices() { Ser
Example
- 继承 1. 实验目的 巩固如下概念: 子类的继承性,子类对象的创建过程,成员变量的继承与隐藏,方法的继承与重写。 2. 实验要求 (1)编写一个Java应用程序,除了主类外,该程序中还要定义4个类:People、ChinaPeople、AmericanPeople和BeijingPeople类,要求如下: People类具有访问权限是protected的double型成员:height和weight,以及public void speakHello()、
JAVAGAME
- 用JAVA语言编写的一个游戏软件,里面还有一些注释,挺好玩的。-public void btnChange(JButton b) { if (b.getBackground() == Color.DARK_GRAY) { b.setBackground(Color.pink) } else {
javadtyx
- 课堂案例&电梯运行public interface Test{ public static final int NUM = 100 public abstract void test() } interface Test2{ public abstract void test2() public abstract void test3() }-Classroom Case & elevator runn
JAVAEcodefans.net
- void方法举例、参数的值传递、重载方法、使用方法计算税款、三角函数方法、min、max和abs方法、生成随机字-void method example, parameter passing, overloaded methods, the use tax calculation, trigonometric method, min, max and abs method to generate random words
book
- 增删改查package entity public class BookInfo { private int bookID private String bookName private String price private String author public int getBookID() { return bookID } public void setBookID(int bookID) { this
JSPExample
- package test public class Simplebean { private String bookname = null private double bookprice = 0 public String getBookname() { return bookname } public void setBookname(String name) { bookname = name }
patternA
- 写一个新的类名叫PatternsA 包括两个方法分别打印pattern1和pattern2-Using your answer from Question 1. Write one new class named PatternsA that contains two methods: i. public void printPattern1() – this method should print pattern1. ii. public void printPattern2()
GourmetCoffeeGUI
- This Work graded 100 class SaveSalesListener implements ActionListener { /** * Saves the sales informations in a file. * * @param event the event object. */ public void actionPerformed(ActionEvent event) { if
uu
- 多个java简单源文件!。。。例如mport java.util.Scanner public class LgOp { public static void main(String[] args) { System.out.print("输入一个数:") Scanner sc=new Scanner(System.in) int Score=sc.nextInt() if(Score>50&&Score 2==0) System