java.lang.Exception: Method OutName(方法名) should be void异常错误解决方案

java.lang.Exception: Method OutName(方法名) should be void异常错误解决方案

使用@Test注解时,被其标识的方法必须是(void)无返回值类型,否则就会出现下图所示的异常信息.此时我们可添加一个public static void main(String[] args){ }主方法进行测试,就能避免使用@Test了.
在这里插入图片描述
下图是成功执行情况:
在这里插入图片描述在这里插入图片描述

posted @ 2020-08-07 19:31  龙韵音  阅读(175)  评论(0)    收藏  举报