Not a member of Pastebin yet?
                        Sign Up,
                        it unlocks many cool features!                    
                - package com.company;
 - class Game{
 - public Game() {
 - super();
 - }
 - }
 - class Football extends Game{
 - Team team;
 - public Football(Team team) {
 - this.team = team;
 - }
 - }
 - class Player{
 - String name;
 - int jn, age, nm;
 - public Player(String name, int jn, int age, int nm) {
 - this.name = name;
 - this.jn = jn;
 - this.age = age;
 - this.nm = nm;
 - }
 - }
 - interface all_position{
 - void Gk();
 - void De();
 - void Mid();
 - void St();
 - }
 - class Team implements all_position{
 - Player p;
 - public Team(Player p) {
 - this.p = p;
 - }
 - @Override
 - public void Gk() {
 - System.out.println("");
 - }
 - @Override
 - public void D() {
 - System.out.println("");
 - }
 - @Override
 - public void M() {
 - System.out.println("");
 - }
 - @Override
 - public void S() {
 - System.out.println("");
 - }
 - }
 - public class Main {
 - public static void main(String args[]) {
 - Player p = new Player("n/a", 1, 18, 54);
 - Team t = new Team(p);
 - Football fb = new Football(t);
 - Game gg = new Game(fb);
 - }
 - }
 
Advertisement
 
                    Add Comment                
                
                        Please, Sign In to add comment