Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class c {
- //Vars
- public static int totAntal;
- //Konstruktorer
- public c() {
- totAntal++;
- }
- //Metoder
- public static void Total() {
- System.out.println(c.totAntal);
- }
- }
- public class Sid130 {
- public static void main(String []args) {
- c c1 = new c();
- c c2 = new c();
- c c3 = new c();
- c.Total();
- c c4 = new c();
- c c5 = new c();
- c.Total();
- }
- }
Add Comment
Please, Sign In to add comment