Java±à³Ì¹æ·¶
packageµÄÃüÃû package µÄÃû×ÖÓÉÈ«²¿Ð¡Ð´µÄ×Öĸ×é³É£¬ÀýÈ磺cn.mybole¡£
classºÍinterfaceµÄÃüÃû classºÍinterfaceµÄÃû×ÖÓÉ´óд×Öĸ¿ªÍ·¶øÆäËû×Öĸ¶¼Ð¡Ð´µÄµ¥´Ê×é³É£¬ÀýÈ磺Person£¬RuntimeException¡£
class±äÁ¿µÄÃüÃû ±äÁ¿µÄÃû×ÖÓÃÒ»¸öСд×Öĸ¿ªÍ·£¬ºóÃæµÄµ¥´ÊÓôóд×Öĸ¿ªÍ·,ÀýÈ磺index£¬currentImage¡£
class·½·¨µÄÃüÃû
·½·¨µÄÃû×ÖÓÃÒ»¸öСд×Öĸ¿ªÍ·£¬ºóÃæµÄµ¥´ÊÓôóд×Öĸ¿ªÍ·,ÀýÈ磺run()£¬getBalance()¡£
static final±äÁ¿µÄÃüÃû static final±äÁ¿µÄÃû×ÖËùÓÐ×Öĸ¶¼´óд£¬²¢ÇÒÄܱíʾÍêÕûº¬Òå¡£ÀýÈ磺PI£¬PASSWORD¡£
²ÎÊýµÄÃüÃû ²ÎÊýµÄÃû×ֺͱäÁ¿µÄÃüÃû¹æ·¶Ò»Ö¡£
Êý×éµÄÃüÃû Êý×éÓ¦¸Ã×ÜÊÇÓÃÕâÑùµÄ·½Ê½À´ÃüÃû£ºbyte[] buffer¡£
Ïà¹ØÎĵµ£º
1. ÄãÐèÒª¾«Í¨ÃæÏò¶ÔÏó·ÖÎöÓëÉè¼Æ£¨OOAOOD£©¡¢É漰ģʽ£¨GOF£¬J2EEDP£©ÒÔ¼°×ÛºÏģʽ¡£ÄãÓ¦¸ÃÁ˽âUML£¬ÓÈÆäÊÇclass¡¢object¡¢interactionÒÔ¼°statediagrams. ¡¡¡¡2. ÄãÐèҪѧϰJavaÓïÑԵĻù´¡ÖªÊ¶ÒÔ¼°ËüµÄºËÐÄÀà¿â£¨collections¡¢serialization¡¢streams¡¢networking¡¢multithreading¡¢reflection¡¢event¡¢handling¡¢N ......
import java.io.*;
class FileTest
{
public static void main(String[] args) throws Exception
{
//File f=new File("1.txt");
//f.createNewFile();
//f.mkdir();
//File f=new File("E:\\JavaLesson\\Lesson7\\1.txt");//ÔÚWindowsϵͳÏÂ,Óþø¶Ô ......
String Óë StringBufferÇø±ð:
String×Ö·û´®¶ÔÏóÊDz»¿É±äµÄ£»StringBufferÊDZ䳤ºÍ¿ÉдµÄ¶¯Ì¬×Ö·ûÐòÁУ¬¿ÉÒÔ×Ô¶¯µØÔö¼Ó¿Õ¼ä¡£
Integer var = new Integer();//ÓÐÓï·¨´íÎó
Integer var = new Integer(2);//悦﵀
javaµÄVector³ÉÔ±ÊÇÒªÓÃelementAt(i)³ÉÔ±º¯ÊýÀ´»ñµÃµÄ£¬²»ÄÜÓÃve[i]µÃµ½¡£
Vector::public Enumeration& ......
C++ÓëJavaµÄÓï·¨Çø±ð
Ê×ÏÈ£¬Á½¸ö´óµÄ²»Í¬ÊÇÖ÷º¯ÊýºÍÔõÑù±àÒëµÄ²»Í¬£¬½ÓÏÂÀ´ÊÇÐí¶àСµÄÇø±ð¡£
main º¯Êý
C++
//×ÔÓɸ¡¶¯µÄº¯Êý
int main( int argc, char* argv[])
{
printf( "Hello, world" );
}
Java
// ÿ¸öº¯Êý¶¼±ØÐëÊÇÒ»¸öÀàµÄÒ»²¿·Ö;µ±java <class>ÔËÐÐÊÇÒ»¸öÌض¨ÀàµÄÖ÷º¯Êý»á±»µ÷ ......