摘要: /** *//** (C) 北大青鳥APTECH.
* 版權(quán)所有
*/
/** *//**
* 本程序?qū)胨璧念?
*/
import java.io.File;
import java.io.BufferedR... 閱讀全文
摘要: /** *//** (C) 北大青鳥APTECH.
* 版權(quán)所有
*/
/** *//**
* 本程序?qū)胨璧念?
*/
import java.io.File;
import java.io.BufferedR... 閱讀全文
摘要: /** *//** (C) 北大青鳥APTECH.
* 版權(quán)所有
*/
/** *//**
* 本程序?qū)胨璧念?
*/
import java.io.File;
import java.io.BufferedR... 閱讀全文
摘要: /**//* 北大青鳥APTECH
* 版權(quán)所有
*/
/** *//**
* 這個(gè)程序演示抽象類和方法的用法.
* @版本 1.0 2005 年 5 月 20 日
* @author M... 閱讀全文
/**
* 測試數(shù)組元素拷貝
*/
public class ArrayCopy
{
public static void main(String[] args)
{
ArrayCopy aCopy = new ArrayCopy();
int[] a = {1, 2, 3, 4, 5};
int[] b = {10,20,30,40,50};
aCopy.copy(a, b);
}
public void copy(int[] from, int[] to)
{
System.out.println("第一個(gè)數(shù)組中的元素");
for (int i = 0; i < from.length; i++)
{
System.out.print(" " + from[i]);//打印出數(shù)組中的每一個(gè)元素
}
System.out.println("\n");
System.out.println("第二個(gè)數(shù)組中的元素");
for (int i = 0; i < to.length; i++)
{
System.out.print(" " + to[i]);//打印出數(shù)組中的每一個(gè)元素
}
System.out.println("\n\n將第一個(gè)數(shù)組拷貝到第二個(gè)數(shù)組\n");
System.arraycopy(from, 2, to, 0, 3);
System.out.println("拷貝完成后第二個(gè)數(shù)組中的元素");
for (int i = 0; i < to.length; i++)
{
System.out.print(" " + to[i]);//打印出數(shù)組中的每一個(gè)元素
}
}
}
輸出結(jié)果是3 4 5 40 50
摘要: <%@page language="java" import="java.util.*,java.sql.*,Oper.*,voo.*" pageEncoding="GBK"%>
<table border=1>
<tr>
<th>編號</th>... 閱讀全文
import java.util.Date;
import java.util.Map;
import java.util.TreeMap;
class SuppressWarningsTest


{
public static void main(String[] args)

{
Map<String,Date> map=new TreeMap<String,Date>();
map.put("hello",new Date());
System.out.println(map.get("hello"));
}
}

import java.util.Date;
import java.util.Map;
import java.util.TreeMap;
class SuppressWarningsTest2


{
public static void main(String[] args)

{
Map map=new TreeMap();
//Map<String,Date> map=new TreeMap<String,Date>();
map.put("hello",new Date());
System.out.println(map.get("hello"));
}
}

import java.util.Date;
import java.util.Map;
import java.util.TreeMap;
class SuppressWarningsTest3


{
@SuppressWarnings("unchecked")
public static void main(String[] args)

{
Map map=new TreeMap();
//Map<String,Date> map=new TreeMap<String,Date>();
map.put("hello",new Date());
System.out.println(map.get("hello"));
}
}

import java.util.Date;
import java.util.Map;
import java.util.TreeMap;
class DeprecatedTest


{

public void doSomething()
{
System.out.println("guoxinghua");
}
public static void main(String[] args)

{
DeprecatedTest test=new DeprecatedTest();
test.doSomething();
}
}

class SuppressWarningsTest2


{
public static void main(String[] args)

{
Map map=new TreeMap();
//Map<String,Date> map=new TreeMap<String,Date>();
map.put("hello",new Date());
System.out.println(map.get("hello"));
}
}

import java.util.Date;
import java.util.Map;
import java.util.TreeMap;
class DeprecatedTest


{

public void doSomething()
{
System.out.println("guoxinghua");
}
public static void main(String[] args)

{
DeprecatedTest test=new DeprecatedTest();
test.doSomething();
}
}

class SuppressWarningsTest2


{

@SuppressWarnings(
{"unchecked","deprecation"})
public static void main(String[] args)

{
Map map=new TreeMap();
//Map<String,Date> map=new TreeMap<String,Date>();
map.put("hello",new Date());
System.out.println(map.get("hello"));
DeprecatedTest test=new DeprecatedTest();
test.doSomething();
}
}
