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
Ïà¹ØÎĵµ£º
ÏÈÀ´Á˽âÒ»ÏÂÁ´±íģʽµÄÔÀí£º
Ê×ÏÈдһ¸öJavaBean£¬ÄÚÈÝÊÇÒªÌí¼ÓµÄÔªËغ͸ÃÔªËصĽڵ㡣
public class NodeBean implements Serializable
{
private Object data; //ÔªËر¾Éí
private NodeBean next; //ÏÂÒ»¸ö½Úµã
&n ......
1£¬intÓëbytes ת»»
intת»»³Ébytes
public
static
final
byte
[]
int2bytes
(
int
value
)
{
return
new
byte
[]
{
(
byte
)(
value
>>>
24
),
(
byte
)(
value
>>>
16
),
......
public static void CentreWnd(Shell shell){
int width = shell.getMonitor().getClientArea().width;
int height = shell.getMonitor().getClientArea().height;
int x = shell.getSize().x;
int y = shell.getSize().y;
if (x > width) {
shell.getSize().x = width;
}
if (y > height) ......
Ḭ̈߳²È« ʲôÊÇḬ̈߳²È«(thread-safe)£¿ Ò»¸öÀ࣬Èç¹ûÄܹ»ÔÚ¶àÏ̲߳¢·¢·ÃÎʵĻ·¾³Ï£¨²»¹ÜÏ̷߳ÃÎʵÄ˳Ðò£©ÕýÈ·±íÏÖ×Ô¼ºµÄÐÐΪ£¬²¢ÇÒÎÞÐèÍⲿµ÷ÓÃÌí¼ÓÈκÎͬ²½Ö®ÀàµÄ²Ù×÷£¬Õâ¸öÀà¾ÍÊÇḬ̈߳²È«µÄ¡£
Õâ¸öÕýÈ·ÐÔ¿ÉÒÔÕâôÀí½â£¬¾ÍÊÇ˵¶àÏ̷߳ÃÎʵĽá¹û²»»á²»Í¬ÓÚµ¥Ï̵߳ķÃÎÊ¡£
Ḭ̈߳²È«µÄÀ಻ÐèÒªÍⲿµ÷ÓÃÌá¹©È ......