-
-
Save anonymous/0b81793e1972c3cccd81 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
public class Version { | |
private int major; | |
private int minor; | |
private int bugfix; | |
public Version(String version) { | |
int dot1 = version.indexOf('.'); | |
int dot2 = version.lastIndexOf('.'); | |
major = Integer.parseInt(version.substring(0, dot1)); | |
minor = Integer.parseInt(version.substring(dot1 + 1, dot2)); | |
bugfix = Integer.parseInt(version.substring(dot2 + 1)); | |
} | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment