Created
December 17, 2016 14:56
-
-
Save edinak1/dc430d80ae79daf54057ae6a705368dc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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