java ÃæÊÔÌâ
Java
»ù´¡·½Ãæ
:
1
¡¢
char
ÐͱäÁ¿ÖÐÄܲ»ÄÜ´æÖüÒ»¸öÖÐÎĺº×Ö
?
Ϊʲô
?
´ð£º
ÊÇÄܹ»¶¨Òå³ÉΪһ¸öÖÐÎĵģ¬ÒòΪjavaÖÐÒÔunicode±àÂ룬һ¸öcharÕ¼16×Ö½Ú£¬ËùÒÔ·ÅÒ»¸öÖÐÎÄÊÇûÎÊÌâµÄ
2:
À¬»ø»ØÊÕ»úÖÆ
,
ÈçºÎÓÅ»¯³ÌÐò
?
A:javaÖеÄÀ¬»øÊÕ¼¯
£¨Garbage Collection,GC£©ÓÃÀ´»ØÊÕÄÇЩ¹ýÈ¥·ÖÅäµÄ²»ÔÙÓÐÓõĶÔÏóµÄ¶Ñ¿Õ¼ä¡£
²éÕÒºÍÒƶ¯ÎÞЧ¶ÔÏóµÄ¹ý³Ì²»½ö¿ÉÒÔʹjavaÓ¦
ÓóÌÐòÍ£Ö¹£¬Í¬Ê±»áÏûºÄ´óÔ¼25%µÄÍÌÍÂÁ¿¡£
¿ÉÒÔͨ¹ýSystem.gc();½øÐÐÀ¬»øÊÕ¼¯¡£
3
¡¢
Java
ÖÐ
Òì³£´¦Àí»úÖÆ£¬Ê¼þ»úÖÆ£¿
4
¡¢
JAVA
ÖеĶà̬Óë¼Ì³Ð£¿
:µ±Ò»¸öÀàÓµÓÐÁíÒ»¸öÀàµÄËùÓÐÊý¾ÝºÍ²Ù×÷ʱ£¬¾Í³ÆÕâÁ½¸öÀàÖ®¼ä´æÔÚ׿̳йØϵ¡£
±»¼Ì³ÐµÄÀà³ÆΪ¸¸Àà»ò³¬À࣬¼Ì³ÐÁ˸¸ÀàµÄËùÓÐÊý¾ÝºÍ²Ù×÷
µÄÀà¾ÍΪ×ÓÀà¡£
Ò»¸ö¸¸Àà¿ÉÒÔͬʱӵÓжà¸ö×ÓÀ࣬¸¸Ààʵ¼ÊÊÇËùÓÐ×ÓÀàµÄ¹«¹²ÓòºÍ¹«¹²·½·¨µÄ¼¯ºÏ£»
¶øÿһ¸ö×ÓÀàÔòÊǸ¸ÀàµÄÌØÊ⻯£¬ÊǶԸ¸À๫¹²ÓòºÍ·½·¨
ÔÚ¹¦ÄÜ¡¢ÄÚº·½ÃæµÄÀ©Õ¹ºÍÑÓÉì¡£
JavaÓïÑԵĶà̬ÊÇÖ¸³ÌÐòÖÐͬÃûµÄ²»Í¬·½·¨¹²´æµÄÇé¿ö¡£¶à̬ÊÇÃæÏò¶ÔÏó³ÌÐòÉè¼ÆµÄÓÖÒ»¸öÌØÐÔ¡£
Ãæ
Ïò¶ÔÏó³ÌÐòÉè¼ÆÖУ¬ÀûÓÃÕâÖÖ¶à̬À´Ìá¸ß³ÌÐòµÄ³éÏóÐÔ£¬Í»³öJavaÓïÑԵļ̳ÐÐÔ¡£
5
¡¢³éÏóÀàÓë½Ó¿Ú£¿
´ð£º³éÏóÀàÓë½Ó¿Ú¶¼ÓÃÓÚ³éÏ󣬵«ÊdzéÏóÀà(JAVAÖÐ)¿ÉÒÔÓÐ×Ô¼ºµÄ²¿·Öʵ
ÏÖ£¬¶ø½Ó¿ÚÔòÍêÈ«ÊÇÒ»¸ö±êʶ(ͬʱÓжàÖؼ̳еŦÄÜ)¡£
6
¡¢
Java
µÄͨÐűà³Ì£¬±à³ÌÌâ
(
»òÎÊ´ð
)
£¬
ÓÃ
JAVA SOCKET
±à³Ì£¬¶Á·þÎñÆ÷¼¸¸ö×Ö·û£¬ÔÙдÈë±¾µØÏÔʾ£¿
´ð:Server¶Ë³ÌÐò:
package
test;
import java.net.*;
import java.io.*;
public class Server
{
private ServerSocket ss;
private
Socket socket;
private BufferedReader in;
private PrintWriter
out;
public Server()
{
try
{
ss=new
ServerSocket(10000);
while(true)
{
socket =
ss.accept();
String RemoteIP =
socket.getInetAddress().getHostAddress();
String RemotePort =
":"+socket.getLocalPort();
System.out.println("A client come
in!IP:"+RemoteIP+RemotePort)
Ïà¹ØÎĵµ£º
eclipseÑ¡Ò»¸ö±äÁ¿ºó£¬Õâ¸öÀàÀïµÄ¸Ã±äÁ¿²»±äÉ«ÎÊÌâ½â¾ö£º
alt + shift + o
/**
* дÈëÈÕÖ¾
* filePath ÈÕÖ¾ÎļþµÄ·¾¶
* code ҪдÈëÈÕÖ¾ÎļþµÄÄÚÈÝ
*/
public
static
boolean
print(String filePath,String code) {
try
{
File tofile
=
new
File(filePath);
......
/*
* GetMacAddress .java
*
* description:get Mac addreess
*
* @author hadeslee
*
* Created on 2007-9-27, 9:11:15
*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package test2;
import java.io.BufferedReader;
import java.io.IO ......
½ñÌìѧϰÁËapplet²¼¾ÖÎÊÌ⣺
°´Å¥¡¢±êÇ©ÊÇÔõÑù¼ÓÈëµ½applet³ÌÐò(ÈÝÆ÷)µ±ÖÐÈ¥µÄÄØ£¿
ÐèÒªÓõ½²¼¾ÖÈÝÆ÷¹ÜÀíÆ÷(LayoutManager)£ºËüÓÃÓÚÐÖúÈÝÆ÷È·¶¨¼ÓÈëµÄ×é¼þ(°´Å¥µÈ)Ó¦¸Ã·ÅÖõÄλÖÃ
awtÌṩÁË4Öг£ÓõIJ¼¾ÖÈÝÆ÷¹ÜÀíÆ÷
>>FlowLayout
>>BorderLayout
>>GridLayout
>>CardLayout
appletĬÈÏÊ¹Ó ......
ÔÚ²©¿ÍÔ°ÉÏ¿´µ½ÕâÑùµÄ´úÂ룬°ÑËü´ò°ü³ÉÒ»¸öexeÎļþ
public class Test
{
public static void main(String[] args)
{
String str="C:\\Program Files\\Tencent\\TM2009\\Bin\\TM.exe";
......