How to enable the Java keyword assert in Eclipse program-wise?

前端 未结 6 848
无人共我
无人共我 2020-11-27 05:44

How can I enable the assert keyword in Eclipse?

public class A
{
    public static void main(String ... args)
    {
        System.out.println(1         


        
6条回答
  •  悲&欢浪女
    2020-11-27 06:30

    You need to go to run configurations and add vm arguments as "-enableassertions" (or) "-ea"

    After that when you run code with assert statement, you will see assert in action.

提交回复
热议问题