JavaÓëC++µÄ¶à̬
ûÓбØÒªÓÃÒ»¶ÑÈÆ¿ÚµÄÐÎÈÝ´ÊÀ´ÃèÊöʲô½Ð¶à̬£¬Ö»¾Ù³ö¼¸¸ö¹Ø¼üµã¡£
É裺gunΪ¸¸À࣬shootgunºÍpistolΪgunµÄ×ÓÀà¡£
Java:
class gun {
void shoot() {
System.out.println("gun shoot");
}
}
class shootgun extends gun {
void shoot() {
System.out.println("shootgun shoot");
}
}
class pistol extends gun {
void shoot() {
System.out.println("pistol shoot");
}
}
C++:
class gun
{
void shoot()
{
cout << "gun shoot" << endl;
}
};
class shootgun : gun
{
void shoot()
{
cout << "shootgun shoot" << endl;
}
};
class pistol : gun
{
void shoot()
{
cout << "pistol shoot" << endl;
&n
Ïà¹ØÎĵµ£º
http://www.javaworld.com/javaworld/javaqa/2000-05/03-qa-0526-pass.html
Does Java pass by reference or pass by value?
Why can't you swap in Java?
By Tony
Sintes, JavaWorld.com, 05/26/00
Print
Email
Feedback
Resources
Discuss
(76)
Digg
Reddit
SlashDot
Stumble
......
ÏÂÎÄÊÇÈÕ±¾ÈË·ÒëµÄÀÏÍâµÄÎÄÕ£¬ÈÕ±¾ÓÐÒ»°ïÈËÔÚ³´Ruby£¬ºÃÏñÊÇÈÕ±¾ÈË·¢Ã÷µÄ£¬Èç¹û¹Ø×¢µÄÈ˶àÁËÒ²ÓпÉÄÜÔÚÒ»¶¨µÄ·¶Î§ÄÚÁ÷ÐÐÆðÀ´¡£
´ËÎĽéÉÜÁËScooter framework¿ò¼Ü£¬ÊÇ»ùÓÚRuby on Rails ¹¹ÖþµÄ£¬ÊÇÒ»¸öSSH¿ª·¢¼¯³ÉµÄÌæ´úÆ·£¬Óõ½ÁËJAVAµÄһЩµ×²ã¼¼Êõ£¬ÓкܶàеĸÅÄ1.0°æ±¾Ô¤¼Æ½ñÄê6£¬7Ô·ݷ¢²¼¡£Ã²Ëƹ¦ÄܺÜÇ¿´ó£¬¸ÐÐ ......
1¡¢´´½¨ÁËÒ»¸ö¶ÔÏóºó£º
£¨1£©Ã»ÓÐÔÚÊʵ±µÄµØ·½Êͷŵô
£¨2£©ÔÚÓ¦¸ÃÊͷŵĵط½Ã»ÓÐ×öÊͷŲÙ×÷
ÀýÈ磺ÏÂÃæÒ»¶Î³ÌÐò£º
m_progressDlg = ProgressDialog.show(this, getString(R.string.market),getString(R.string.is_visiting), true);
new Thread() {
public v ......
//´ÓÊý×éaÖÐɾ³ýÊý×ébÖдæÔÚµÄÔªËØ
String stra[] = {"g","b","c","h","k"};//ÔʼÊý×é
String strb[] = {"g","k"}; //ÒƳýµÄÔªËØ
ArrayList list = new ArrayList();
//·½·¨Ò»
for(int i=0;i<stra.length;i++){
int n=0;
......
Ḭ̈߳²È« ʲôÊÇḬ̈߳²È«(thread-safe)£¿ Ò»¸öÀ࣬Èç¹ûÄܹ»ÔÚ¶àÏ̲߳¢·¢·ÃÎʵĻ·¾³Ï£¨²»¹ÜÏ̷߳ÃÎʵÄ˳Ðò£©ÕýÈ·±íÏÖ×Ô¼ºµÄÐÐΪ£¬²¢ÇÒÎÞÐèÍⲿµ÷ÓÃÌí¼ÓÈκÎͬ²½Ö®ÀàµÄ²Ù×÷£¬Õâ¸öÀà¾ÍÊÇḬ̈߳²È«µÄ¡£
Õâ¸öÕýÈ·ÐÔ¿ÉÒÔÕâôÀí½â£¬¾ÍÊÇ˵¶àÏ̷߳ÃÎʵĽá¹û²»»á²»Í¬ÓÚµ¥Ï̵߳ķÃÎÊ¡£
Ḭ̈߳²È«µÄÀ಻ÐèÒªÍⲿµ÷ÓÃÌá¹©È ......