C/C++ÓëJavaº¯ÊýÖØÔØÇø±ð!
#include <iostream>
using namespace std;
class Base {
public:
virtual void fn(int x) {
cout << "In Base class, int x = " << x << endl;
}
};
class SubClass : public Base {
public:
// º¯ÊýµÄÖØÔØ,ÕâÑùµÄÖØÔØ·½Ê½,ÔÚJavaÖÐÄÜÐÐ,ÔÚC/C++ÖÐÈ´²»ÐÐ
virtual void fn(float x) {
cout << "In SubClass, float x = " << x << endl;
}
};
void test(Base& b) {
int i = 1;
b.fn(i);
float f = 2.0;
b.fn(f);
}
int main() {
Base bc;
SubClass sc;
cout << "Calling test(bc)\n";
test(bc);
cout << "Calling test(sc)\n";
test(sc);
return 0;
}
Calling test(bc)
In Base class, int x = 1
In Base class, int x = 2
Calling test(sc)
In Base class, int x = 1
In Base class, int x = 2
ÔËÐгɹ¦£¨×ܼÆʱ¼ä£º 312ºÁÃ룩
×¢Òâ,¶¼Êǵ÷Óõĸ¸ÀàÖеĺ¯Êý.
package cn.vicky;
public class MyTest {
public void add(int i) {
System.out.println("in parent");
}
public static void main(String[] args) {
MyTest2 m2 = new MyTest2();
m2.add(1);
m2.add(1.1);
}
}
class MyTest2 extends MyTest {
public void add(double i) {
System.out.println("in child");
}
}
in parent
in child
JavaÈ´¿ÉÒÔÇø·Ö...
Ïà¹ØÎĵµ£º
package stone;
public class PrimerNumber {
public static void main(String[] args) {
int MAX_NUMBER = 100;
boolean[] notPrimer= new boolean[MAX_NUMBER];
for(int i=2;i<=MAX_NUMBER;i++){
if(!notPrimer[i-1]){
for(int j=2*i;j<=MAX_NUMBER;j++){
if(j%i==0) notPrimer[j-1]=tr ......
ƪÎÄÕÂÊÇ×î½ü¸Õ¿´µ½µÄ£¬ËäÈ»ÊÇ˵³ÌÐòÔ±´ÓC++תJAVAÐèҪעÒâµÄµØ·½£¬µ«ÊǺÜÏêϸµÄ˵³öÁËC++ºÍJAVAµÄ²»Í¬µÄµØ·½£¬¶ÔÓÚJAVAÖÐΪʲôûÓÐÖ¸Õ롢ΪʲôûÓÐÄÚ´æй¶¡¢½Ó¿ÚºÍC++ÖжàÖؼ̳еĹØϵ¡¢Òì³£»úÖƵÈÎÊÌâÒ²ÃèÊöµÄºÜÏêϸ£¬¹ÊתÔعýÀ´¡£
1.JavaÔÚÐéÄâ»úÉÏÔËÐÐ
JavaÔ´´úÂë²¢²»ÊDZ»±àÒë³ÉΪÆÕͨµÄ»úÆ÷´úÂë¡£¶øÊDZ»·Òë³ÉÎ ......
ÔÚSUNÍƳö LWUIT¿ª·¢°ü֮ǰ£¬ÔÚJava MEƽ̨ÉÏ¿ª·¢Óû§½çÃæ²¢²»ÊÇÒ»¼þÈÝÒ×µÄÊ£¬ÓÈÆäÊÇÏë×ö³öºÜÑ£µÄ½çÃ棬¸üÊÇÄÑÉϼÓÄÑ£¬ÕâÊÇÒòΪÓÉMIDP±¾ÉíÌṩµÄÓû§½çÃæÔªËØ£¬°üjavax.microedition.lcdui
ÖÐÌṩµÄ×é¼þ¹¦ÄÜÏà¶Ô¼òµ¥¡£
ʹÓà LWUIT ¿ª·¢°ü£¬¿ª·¢ÈËÔ±²»ÔÙÐèÒª±àдÓëÉ豸ÆÁÄ»´óСÏà¹ØµÄ´úÂ룬Ëü²ÉÓÃÁËÓëSwing ÏàËƵĸÅÄîÌá ......
xmlÎļþÈçÏ ÅäÖù¦ÄÜ¿ª¹Ø
<Configurations>
<Samples>true</Samples>
<Excepts>true</Excepts>
<CheckFace>false</CheckFace>
<ThumbNail>false</ThumbNail>
&nbs ......
alloc.h
brk
¡¾¹¦ÄÜ¡¿¸ü¸ÄÊý¾Ý¶Î¿Õ¼äµÄ·ÖÅä
¡¾ÔÐÍ¡¿int brk(void *endds)
¡¾Î»Öá¿alloc.h
¡¾ËµÃ÷¡¿½«³ÌÐòÊý¾Ý¶ÎµÄ¶¥²¿ÉèÖÃΪenddsËùÖ¸ÏòµÄÄÚ´æλÖᣵ÷Óóɹ¦Ö®ºó£¬·µ»Ø0¡£Èç¹ûµ÷ÓÃʧ°ÜÔò·µ»Ø-1£¬Í¬Ê±ÉèÖÃerrno¡£
¡¾²Î¼û¡¿coreleft
calloc
¡¾¹¦ÄÜ¡¿·ÖÅäÄÚ´æ¡£
¡¾ÔÐÍ¡¿void *calloc(size_t nelem,size_t elsize) ......