I have just been looking into assert in Java and now I am trying to figure out how can we view the message if the assert was true in Eclipse. Code below:
public class TheAssertClass {
public TheAssertClass(){
int y = 5;
int x = 4;
assert (y > x): "y is too big. y = " + y;
}
public static void main(String[] args){
TheAssertClass go = new TheAssertClass();
System.out.println("The program ran");
}
}
The console only displays "The program ran". I am not exactly sure if I am using this correctly?
Thanks.