Skip to content

Instantly share code, notes, and snippets.

@edinak1
Created December 17, 2016 10:46
Show Gist options
  • Save edinak1/57f730214a445c19d9f5db3083c3ac42 to your computer and use it in GitHub Desktop.
Save edinak1/57f730214a445c19d9f5db3083c3ac42 to your computer and use it in GitHub Desktop.
package tank;
public class Tanki {
public static void main(String [] args){
Tank tank = new Tank();
parametrTank(tank);
printTankInfo(tank);
}
public static class Tank{
String color;
int maxSpeed;
int crew;
}
public static void parametrTank(Tank tank){
tank.color = "red";
tank.crew = 4;
tank.maxSpeed = 50;
}
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