Skip to content

Instantly share code, notes, and snippets.

@edinak1
Created December 17, 2016 14:56
Show Gist options
  • Save edinak1/dc430d80ae79daf54057ae6a705368dc to your computer and use it in GitHub Desktop.
Save edinak1/dc430d80ae79daf54057ae6a705368dc to your computer and use it in GitHub Desktop.
package tank;
public class Tanki {
public static void main(String [] args){
Tank tank= new Tank("red",4,50);
printTankInfo(tank);
}
public static class Tank{
String color;
int maxSpeed;
int crew;
Tank(String color,int crew,int maxSpeed){
this.color = color;
this.crew = crew;
this.maxSpeed =maxSpeed;
}
}
public static void printTankInfo(Tank tank){
System.out.println(tank.color);
System.out.println(tank.crew);
System.out.println(tank.maxSpeed);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment