Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MyClass {
- private static void func1() { // со статик
- ...
- }
- }
- public class MyClass {
- private void func1() { // без статик
- ...
- }
- }
- private static int hugeCapacity(int minCapacity) {
- if (minCapacity < 0) // overflow
- throw new OutOfMemoryError();
- return (minCapacity > MAX_ARRAY_SIZE) ?
- Integer.MAX_VALUE :
- MAX_ARRAY_SIZE;
- }
- public class Car {
- private static double convertToMiles(double km){
- return km*0.621371192;
- }
- }
- class Knight : Warrior {
- private Weapon createMainWeapon() {
- return new Sword();
- }
- private Dagger getDagger() {
- return null;
- }
- }
- class Knight : Warrior {
- static int numberOfKnights;
- public Knight() {
- numberOfKnights++;
- }
- public static int getNumber() {
- return numberOfKnights;
- }
- }
- class Squire {
- Knight master;
- public prepareForBattle() {
- ...
- }
- }
Add Comment
Please, Sign In to add comment