Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package pilka;
- public class Pilka implements Odbijanie{
- @Override
- public void odbijaj() {
- System.out.print("Bum bum\n");
- }
- @Override
- public void czestoscOdbijania(float czestosc) {
- for(int i=0; i<czestosc; i++) {
- System.out.print(i+1+":");
- odbijaj();
- }
- }
- public static void main(String[] args) {
- Pilka p1 = new Pilka();
- p1.czestoscOdbijania(5);
- p1.odbijaj();
- }
- }
- //--------------------------------------------
- package pilka;
- public interface Odbijanie {
- public void odbijaj();
- public void czestoscOdbijania(float czestosc);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement