Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Some {
- private int ping;
- private String pong;
- //Static members belongs to the class. There is no need of an object creation for use static members.
- public static final String birth = "Since 1895";
- Some(int pi, String po) {
- this.ping = pi;
- this.pong = po;
- }
- public String showTime() {
- return Integer.toString(this.ping) + " with " + pong;
- }
- public static void main(String[] args) {
- String out = new Some(1, "pong").showTime();
- String since = Some.birth;
- System.out.println(out);
- System.out.println(since);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement