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

Java±à³Ì£ºÊµÀý·ÖÎöJ2MEÍøÂç±à³ÌµÄÁ½ÖÖ·½·¨


ºËÐÄÌáʾ£º±¾ÎÄÃèÊöÁËÔÚJ2meÖпª·¢Ö÷ҪʹÓõÄÍøÂçÁ¬½Ó·½·¨£¬·Ö±ðÏêϸ½éÉÜÁËʹÓÃhttpºÍsocketÁ½ÖÖ·½·¨¡£ HttpConnection Ê×ÏÈÎÒÃÇÏÈÀ´¿´Ò»¸ö¼òµ¥µÄÀý×Ó°É£º Ö÷ÒªÓõ½µÄjava°ü£º javax.microedition.io.*; public String requestGET(String URLString,String URL) throws
±¾ÎÄÃèÊöÁËÔÚJ2meÖпª·¢Ö÷ҪʹÓõÄÍøÂçÁ¬½Ó·½·¨£¬·Ö±ðÏêϸ½éÉÜÁËʹÓÃhttpºÍsocketÁ½ÖÖ·½·¨¡£
 HttpConnection
 Ê×ÏÈÎÒÃÇÏÈÀ´¿´Ò»¸ö¼òµ¥µÄÀý×Ó°É£º
Ö÷ÒªÓõ½µÄjava°ü£º
 javax.microedition.io.*;
 public¡¡String¡¡requestGET(String¡¡URLString,String¡¡URL)¡¡throws¡¡IOException{
//¡¡=====================================
//¡¡URLStringÊÇHTTPµØÖ·£¬URLΪºóÃæµÄ²ÎÊý
//¡¡ÕâÀïµÄÀý×ÓÊÇ·¢ËÍÓõÄÓû§ÃûºÍÃÜÂëµ½·þÎñÆ÷¶Ë½øÐÐÓû§ÑéÖ¤
//¡¡±ÈÈç¡¡String¡¡URLString¡¡=¡¡"http://192.168.0.1:8080/login.jsp";
//¡¡String¡¡URL¡¡=¡¡"?Name="+this.txtName+"&Pass="+this.txtPass
//¡¡=====================================
HttpConnection¡¡hpc¡¡=¡¡null;
DataInputStream¡¡dis¡¡=¡¡null;
boolean¡¡newline¡¡=¡¡false;
String¡¡content¡¡=¡¡"";
try{
//¡¡=====================================
//¡¡½¨Á¢Á¬½Ó
//¡¡=====================================
hpc¡¡=¡¡(HttpConnection)Connector.open(URLString+URL);
hpc.setRequestMethod(HttpConnection.GET);
dis¡¡=new¡¡DataInputStream(hpc.openInputStream());
int¡¡character;
//¡¡=====================================
//¡¡¶ÁÈ¡·µ»ØµÄHTTPÄÚÈÝ
//¡¡====================================
while((character¡¡=¡¡dis.read())¡¡!=¡¡-1){
if((char)character¡¡==¡¡'\\'){
newline¡¡=¡¡true;
continue;
}
else{
if((char)character¡¡=='n'&&¡¡newline){
content¡¡+="\n";
newline¡¡=¡¡false;
}
else¡¡if(newline){
content¡¡+="\\"¡¡+(char)character;
newline¡¡=¡¡false;
}
else{
content¡¡+=(char)character;
newline¡¡=¡¡false;
}
}
}
}
catch(IOException¡¡e){
System.out.print("ERROR:"+e);
}
finally{
if(hpc¡¡!=¡¡null){
hpc.close();
hpc¡¡=¡¡null;
}
if(dis¡¡!=¡¡null){
dis.close();
}
}
//¡¡====================================
//¡¡ÓÉÓÚÄÚÈÝ¿ÉÄÜÓÐÖÐÎÄ£¬ËùÒÔÔÚ½ÓÊܵ½ÐÅÏ¢ºóÒª¶ÔÄÚÈݽøÐÐ×Ö·û¼¯µÄת»»
//¡¡====


Ïà¹ØÎĵµ£º

java ¶ÔdoubleµÄ ÓÐȤ´¦Àí £¨j»ù p30£©

ºÜÖǻۣ¬ÆÄÓÐÊýѧÖÐÎÞÇî·ÖÎöµÄÒâζ
Õæ°®ËÀjavaÁË
public class FunnyNumbers {
public static void main(String[] args) {
double largeNum = (int)Math.exp(4000.0);
//int ²»Äܳý0
//Exception in thread "main" java.lang.ArithmeticException: / by zer oat FunnyNumbers.main(FunnyNumbers.j ......

C/C++ÓëJava¶àάÊý×飬±éÀúÓë×î´óÖµ»ñÈ¡·½·¨£¡

C/C++
/*
* File: main.cpp
* Author: Vicky
*
* Created on 2010Äê4ÔÂ29ÈÕ, ÉÏÎç9:46
*/
#include <iostream>
using namespace std;
int maximum(int[], int);
int main(int argc, char** argv) {
// int sg[3][4] = {
int sg[][4] = {
{68, 77, 73, 86},
{87, 96, 7 ......

Java¡¢JSP¡¢HTML¡¢XML±àд¶¼Òª·ûºÏÒÔϱàÂë¹æÔò£¡

1 ËùÓÐµÄ .java|.jsp|.html|.xml Ô´Îļþ¾ùʹÓÃutf-8±àÂë¸ñʽ±£´æµ½ÏµÍ³´ÅÅÌ¡£
È磺ÔÚEclipseÖб༭Îļþ£¬Ñ¡ÖÐÎļþ´ò¿ªÓÒ¼ü²Ëµ¥Ñ¡ÔñÊôÐÔ£¬½«Îı¾Îļþ±àÂëÉèÖÃΪÆäËû²¢Ñ¡ÔñUTF-8£»Ò²¿ÉÒÔÔÚ
Eclipse——Ê×Ñ¡Ïî——³£¹æ——ÄÚÈÝÀàÐÍÖÐÉèÖø÷ÖÖÎļþµÄȱʡ±àÂ룬ÕâÑùÒÔºóËùÓеÄÎı¾Îļþ¶¼Ê¹ÓÃÍ³Ò ......

JAVA³£ÓòÙ×÷Óï¾ä ÏîÄ¿ÖеÄ×ܽá¶þ


jspÊä³ö¸ñʽ»¯ºóµÄÈÕÆÚ
<fmt:formatDate value="${whiteNumber.crtdate }" pattern="yyyy-MM-dd HH:mm:ss"/>
ÈçÊÇmodelÀïµÄlistÔÚactionÖÐÈ¡²»µ½Öµ¡£¿ÉÄÜÔÚ¸ÃmodelÖеÄlistµÄsetterºÍgetter·½Ê½ÖУ¬Ê¹ÓõĿÉÄÜÊÇlazy¼ÓÔØ£¬¸ÄΪEAGER¼´¿É¡£
<s:iterator>±êÇ©ÀﻹÓÐ<s:iterator>± ......

JavaÖÐÀàÓëÀàµÄ¹ØÏµ

ÀàÓëÀàÖ®¼ä´æÔÚÒÔϹØÏµ£º
1¡¢ ·º»¯(Generalization)
ºÜ¼òµ¥£¬¾ÍÊÇÎÒÃdz£ËµµÄ¼Ì³Ð¡£ÊÇ˵×ÓÀà»ñµÃ¸¸ÀàµÄ¹¦ÄܵÄͬʱ£¬»¹¿ÉÒÔÀ©Õ¹×Ô¼ºµÄ¹¦ÄÜ¡£
Èçͼ:
Java´úÂëÖбíÏÖΪ£ºextends ºÍ implements
2¡¢ ÒÀÀµ(Dependency)
Á½¸öÏà¶Ô¶ÀÁ¢µÄßËßË(AºÍB)£¬µ±A¸ºÔð¹¹ÔìBʱ£¬AÓëBÐγÉÒÀÀµ¹ØÏµ£¬¼´AʹÓÃB¡£
Èçͼ£º
Java´úÂëÖеıíÏÖ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ