Last active
February 14, 2019 08:17
-
-
Save athiththan11/cd0f3aa9c782fee37ed78f42871b1a2e to your computer and use it in GitHub Desktop.
`static` keyword usage on fields
This file contains hidden or 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 SmartPhone { | |
private String modelNumber; | |
private String battery; | |
public static int numberOfObjects; | |
public SmartPhone (String modelNumber, String battery) { | |
this.modelNumber = modelNumber; | |
this.battery = battery; | |
numberOfObjects++; | |
} | |
// getters and setters | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment