.


:




:

































 

 

 

 


finalize.




, , . . C++ Object PASCAL , , .

, , , - . , , . . , : , , . , .

Java finalize(). , , , , , . , finalize . System.gk() finalize() , . , .

destroy() - , , ( dispose() , , free() ). -. , , super.destroy(). , . , , , .

, : , . , , , , . super.destroy().

, . . , (overloading) . , , , . , . Java . , .

, . ,

Circle(Graphics g, Color bgColor){

}

 

Circle(Graphics g, Color bgColor, int r){

}

 

 

, .

, - - , . , , . , , .

Math1, - product, , . , , .

 

public class Math1 {

 

public static byte product(byte x, byte y){

return x*y;

}

 

public static short product(short x, short y){

return x*y;

}

 

public static int product(int x, int y){

return x*y;

}

 

public static char product(char x, char y){

return x*y;

}

 

public static long product(long x, long y){

return x*y;

}

 

}

 

, . . (static) , .

 

:

 

public static byte product(byte x, byte y){

return x*y;

}

 

public static int product(byte a, byte b){

return a*b;

}

, . - , .

 

product , , . , byte int? ? , . product(int x, int y) product(long x, long y). - , . , , product(int x, int y).

, , , . , Math2

 

public class Math2 {

 

public static int product(int x, byte y){

return x*y;

}

 

public static int product(byte x, int y){

return x*y;

}

 

}

 

- byte b1, b2 Math1.product(b1,b2). , . , Math2 . , .

, . , , . . , , . , , , , , .





:


: 2017-02-28; !; : 556 |


:

:

, , .
==> ...

1565 - | 1470 -


© 2015-2024 lektsii.org - -

: 0.016 .