String in Java
ÖÚËùÖÜÖª£¬StringÊÇÓÉ×Ö·û×é³ÉµÄ´®£¬ÔÚ³ÌÐòÖÐʹÓÃƵÂʺܸߡ£JavaÖеÄStringÊÇÒ»¸öÀ࣬¶ø²¢·Ç»ù±¾Êý¾ÝÀàÐÍ¡£ ²»¹ýËýÈ´²»ÊÇÆÕͨµÄÀàŶ£¡£¡£¡
¡¾¾µÍ·1¡¿ String¶ÔÏóµÄ´´½¨
1¡¢¹ØÓÚÀà¶ÔÏóµÄ´´½¨£¬ºÜÆÕͨµÄÒ»ÖÖ·½Ê½¾ÍÊÇÀûÓù¹ÔìÆ÷£¬StringÀàÒ²²»ÀýÍ⣺
String s=new String("Hello world");
ÎÊÌ⣺²ÎÊý"Hello world"ÊÇʲô¶«Î÷£¬Ò²ÊÇ×Ö·û´®¶ÔÏóÂð?Ī·ÇÓÃ×Ö·û´®¶ÔÏó´´½¨Ò»¸ö×Ö·û´®¶ÔÏó???
2¡¢µ±È»£¬StringÀà¶ÔÏó»¹ÓÐÒ»ÖÖ´ó¼Ò¶¼ºÜϲ»¶µÄ´´½¨·½Ê½£º
String s="Hello world";
ÎÊÌ⣺Óеã¹Öѽ£¬ÔõôÓë»ù±¾Êý¾ÝÀàÐ͵ĸ³Öµ²Ù×÷£¨int i=1£©ºÜÏñѽ???
ÔÚ¿ªÊ¼½âÊÍÕâЩÎÊÌâ֮ǰ£¬ÎÒÃÇÏÈÒýÈëһЩ±ØÒªµÄ֪ʶ:
(1) Java classÎļþ½á¹¹
ÎÒÃǶ¼ÖªµÀ£¬Java³ÌÐòÒªÔËÐУ¬Ê×ÏÈÐèÒª±àÒëÆ÷½«Ô´´úÂëÎļþ±àÒë³É×Ö½ÚÂëÎļþ(Ò²¾ÍÊÇ.classÎļþ)¡£È»ºóÔÚÓÉJVM½âÊÍÖ´ÐС£
classÎļþÊÇ8λ×ֽڵĶþ½øÖÆÁ÷
¡£ÕâЩ¶þ½øÖÆÁ÷µÄºÒåÓÉһЩ½ô´ÕµÄÓÐÒâÒåµÄÏî
×é³É¡£±ÈÈçclass×Ö½ÚÁ÷ÖÐ×ʼµÄ4¸ö×Ö½Ú×é³ÉµÄÏî½Ð×öħÊý
(magic)£¬ÆäÒâÒåÔÚÓÚ·Ö±æclassÎļþ(ֵΪ0xCAFEBABE)Óë·ÇclassÎļþ¡£class×Ö½ÚÁ÷´óÖ½ṹÈçÏÂͼ×ó²à¡£
ÆäÖУ¬ÔÚclassÎļþÖÐÓÐÒ»¸ö·Ç³£ÖØÒªµÄÏî——³£Á¿³Ø
¡£Õâ¸ö³£Á¿³ØרÃÅ·ÅÖÃÔ´´úÂëÖеij£Á¿ÐÅÏ¢(²¢ÇÒ²»Í¬µÄ³£Á¿´æ·ÅÔÚ²»Í¬±êÖ¾µÄ³£Á¿±íÖÐ)¡£ÈçÉÏͼÓÒ²àÊÇHelloWorld´úÂëÖеij£Á¿±í
£¨HelloWorld´úÂëÈçÏ£©£¬ÆäÖÐÓÐËĸö²»Í¬ÀàÐ͵ij£Á¿±í£¨Ëĸö²»Í¬µÄ³£Á¿³ØÈë¿Ú£©¡£¹ØÓÚ³£Á¿³ØµÄ¾ßÌåϸ½Ú£¬Çë²ÎÕÕ¡¶ÉîÈëJavaÐéÄâ»ú¡·µÚ¶þ°æµÚ
6Õ¡£
Java´úÂë
public
class
HelloWorld{
void
hello(){
System.out.println("Hello world"
);
}
}
publi
Ïà¹ØÎĵµ£º
javaʹÓÃMathÀ࣬phpʹÓÃϵͳº¯Êý
ceil¹¦ÄÜ ´óÓÚµÈÓÚijÊý(³£ÓÃÓÚ·ÖÒ³Ò³Êý¼ÆË㣩
phpÖУºceil(a/b)
javaÖУº(int)Math.ceil((double)a/b)) Math.ceilÔÚjavaÖÐÐèÒª´«ÈëdoubleÐÍ£¬¶ø·µ»ØÒ²ÊÇdoubleÐÍ¡£×¢ÒâÕâÀïÓÃ(double)a/b²Å¿ÉÒÔ¡£
a/b,(dobule)(a/b)¶¼²»ÐС£ÒòΪËûÃÇ»áÏÈ×Ô¶¯ÉáÆúСÊýÈ¡µÃÕûÊý
flooe ......
ÍùÍù»ìÏýÁËÕâÈý¸öº¯ÊýµÄʹÓá£
´Ó²Ù×÷ϵͳµÄ½Ç¶È½²£¬os»áά»¤Ò»¸öready queue£¨¾ÍÐ÷µÄÏ̶߳ÓÁУ©¡£²¢ÇÒÔÚijһʱ¿ÌcpuֻΪready queueÖÐλÓÚ¶ÓÁÐÍ·²¿µÄÏ̷߳þÎñ¡£
µ«Êǵ±Ç°ÕýÔÚ±»·þÎñµÄÏ߳̿ÉÄܾõµÃcpuµÄ·þÎñÖÊÁ¿²»¹»ºÃ£¬ÓÚÊÇÌáÇ°Í˳ö£¬Õâ¾ÍÊÇyield¡£
»òÕßµ±Ç°ÕýÔÚ±»·þÎñµÄÏß³ÌÐèҪ˯һ»á£¬ÐÑÀ´ºó¼ÌÐø±»·þÎñ£¬Õâ¾ÍÊ ......
69¡¢¼òÊöÂß¼²Ù×÷(&,|,^)ÓëÌõ¼þ²Ù×÷(&&,||)µÄÇø±ð¡£
Çø±ðÖ÷Òª´ðÁ½µã£ºa.Ìõ¼þ²Ù×÷Ö»ÄܲÙ×÷²¼¶ûÐ͵Ä,¶øÂß¼²Ù×÷²»½ö¿ÉÒÔ²Ù×÷²¼¶ûÐÍ,¶øÇÒ¿ÉÒÔ²Ù×÷ÊýÖµÐÍ
b.Âß¼²Ù×÷²»»á²úÉú¶Ì·
70¡¢XMLÎĵµ¶¨ÒåÓм¸ÖÖÐÎʽ£¿ËüÃÇÖ®¼äÓкα¾ÖÊÇø±ð£¿½âÎöXMLÎĵµÓÐÄļ¸ÖÖ·½Ê½£¿
a: Á½ÖÖÐÎʽ dtd schema£¬b: ±¾ÖÊÇø ......
1. ÔÚCÓïÑÔÖУ¬ÎÒÃÇͨ³£Ï°¹ß°ÑÐèÒªµÄ¶ÔÏóÉêÃ÷·ÅÔÚº¯ÊýµÄ¿ªÍ·£¬µ«ÆäʵÕâÊÇ°×°×ÀË·ÑÁËÄڴ棬ÔÚJavaÖУ¬²»µ½ÐèÒªµÄʱºò£¬Çë²»Òª´´½¨¶ÔÏó¡£
2. À¬»ø»ØÊջ᲻¶¨ÆÚµÄËÑË÷ÒѾûÓÐÓõĶÔÏó£¬È»ºóÊͷŶÔÏóµÄÄڴ棬µ«ÕâÖÖËÑË÷ÊDZȽϺÄ×ÊÔ´µÄ¡£ÎªÌá¸ßЧÂÊ£ ......
23.±à³ÌʵÏÖÐòÁл¯µÄStudent£¨sno,sname£©¶ÔÏóÔÚÍøÂçÉϵĴ«Êä
package com.softeem.demo;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.net.ServerSocket;
import java.net.Socket;
class Student implem ......