Skip to content
Open

Demo #10

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 15 additions & 12 deletions Counter.java
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
package samples;

import sl4j.logger.log;
package sample;

public class Counter {
private int value;
private static int value = 0;

public Counter() {
this.value = 0;
log.log("Counter created");
}
/**
* Creates a counter instance
* @return Counter instance
*/
private Counter() {}

public int increment(){
return ++this.value;
/**
* Increments the counter value
* @return counter value
*/
public static int increment(){
return ++value;
}

public int reset(){
return this.value = 0;
public static void reset(){
value = 0;
}
}
11 changes: 4 additions & 7 deletions Example_v0.java
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
package controller;
package sample;

import java.util.Random;
import java.awt.font.*;

public class A {
private static int Z;
private static final int Z;

public A() {
A.Z = 5;
}

public int fcn(){
return A.Z * 5;
}

public int test(){
public int production(){
return A.Z * 5;
}
}