Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

java »ñÈ¡ÍøÒ³ÄÚÈÝ

package test;



import java.io.BufferedReader;

import java.io.IOException;

import java.io.InputStream;

import java.io.InputStreamReader;

import java.net.Authenticator;

import java.net.HttpURLConnection;

import java.net.PasswordAuthentication;

import java.net.URL;

import java.net.URLConnection;

import java.util.Properties;



public class URLTest {

// Ò»¸öpublic·½·¨£¬·µ»Ø×Ö·û´®£¬´íÎóÔò·µ»Ø"error open url"

public static String getContent(String strUrl) {

try {

URL url = new URL(strUrl);

BufferedReader br = new BufferedReader(new InputStreamReader(url

.openStream()));

String s = "";

StringBuffer sb = new StringBuffer("");

while ((s = br.readLine()) != null) {

sb.append(s + "\r\n");

}

br.close();

return sb.toString();

} catch (Exception e) {

return "error open url:" + strUrl;

}

}



public static void initProxy(String host, int port, final String username,

final String password) {

Authenticator.setDefault(new Authenticator() {

protected PasswordAuthentication getPasswordAuthentication() {

return new PasswordAuthentication(username,

new String(password).toCharArray());

}

});

System.setProperty("http.proxyType", "4");

System.setProperty("http.proxyPort", Integer.toString(port));

System.setProperty("http.proxyHost", host);

System.setProperty("http.proxySet", "true");

}



public static void main(String[] args) th


Ïà¹ØÎĵµ£º

JavaÉè¼ÆÄ£Ê½Ö®:IteratorÁ´±íģʽ

ÏÈÀ´Á˽âÒ»ÏÂÁ´±íģʽµÄÔ­Àí£º
Ê×ÏÈдһ¸öJavaBean£¬ÄÚÈÝÊÇÒªÌí¼ÓµÄÔªËØºÍ¸ÃÔªËØµÄ½Úµã¡£
public class NodeBean implements Serializable
{
   
    private Object data; //ÔªËØ±¾Éí
    private NodeBean next; //ÏÂÒ»¸ö½Úµã
   
  &n ......

JavaÄÚ²¿ÀࣨInner Class£©

¼òµ¥µÄ˵£¬ÄÚ²¿£¨inner£©ÀàÖ¸ÄÇЩÀඨÒå´úÂë±»ÖÃÓÚÆäËüÀඨÒåÖеÄÀࣻ¶ø¶ÔÓÚÒ»°ãµÄ¡¢ÀඨÒå´úÂ벻ǶÌ×ÔÚÆäËüÀඨÒåÖеÄÀ࣬³ÆÎª¶¥²ã£¨top-level£©Àà¡£¶ÔÓÚÒ»¸öÄÚ²¿À࣬°üº¬Æä¶¨Òå´úÂëµÄÀà³ÆÎªËüµÄÍⲿ£¨outer£©Àà¡£
1 Static member class£¨¾²Ì¬³ÉÔ±Àࣩ
ÀàÉùÃ÷Öаüº¬“static”¹Ø¼ü×ÖµÄÄÚ²¿Àà¡£ÈçÒÔÏ ......

javaµÄ(PO,VO,TO,BO,DAO,POJO)½âÊÍ

O/R Mapping ÊÇ Object Relational Mapping£¨¶ÔÏó¹ØÏµÓ³É䣩µÄËõд¡£Í¨Ë׵㽲£¬¾ÍÊǽ«¶ÔÏóÓë¹ØÏµÊý¾Ý¿â°ó¶¨£¬ÓöÔÏóÀ´±íʾ¹ØÏµÊý¾Ý¡£ÔÚO/R MappingµÄÊÀ½çÀÓÐÁ½¸ö»ù±¾µÄÒ²ÊÇÖØÒªµÄ¶«¶«ÐèÒªÁ˽⣬¼´VO£¬PO¡£
¡¡¡¡VO£¬Öµ¶ÔÏó(Value Object)£¬PO£¬³Ö¾Ã¶ÔÏó(Persisent Object)£¬ËüÃÇÊÇÓÉÒ»×éÊôÐÔºÍÊôÐÔµÄgetºÍset·½·¨×é³É¡£´ ......

java³ÌÐòÖÐString args[]Æðʲô×÷Óã¿

ÔÚÏÂÃæÕâ¸ö³ÌÐòÖÐString args[]Æðʲô×÷Óã¿ÎÒѧ¹ýC++£¬String args[]ÓëC++ÖеÄʲôÀàËÆ£¿Èç¹ûÊÇC++£¬ÏëÒªÊä³ö×Ö·û´®Ö»ÒªÔÚÏÂÃæÐ´cout<<"...."<<endl;¾Í¿ÉÒÔÁË,void main()ÖеÄÀ¨ºÅΪ¿Õ£¬¶øjavaÖÐΪʲôҪдString args[]ÄØ£¿
class Example{
public static void main(String args[]){
System.out.printl ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ