已解决问题
谷歌ylx8000用户在2013.10.12提交了关于“威海j**a 断言”的提问,欢迎大家涌跃发表自己的观点。目前共有1个回答,最后更新于2024-08-24T15:06:45。classTest{
voidprocess(intage)
{
assertage<=0:"年龄有误";
System.out.println(age);
}
publicstaticvoidmain(String[]args)
{
newTest().process(-5);
}
}
在编译的时候j**ac***.j**a会出现
C:\>j**ac***.j**a
***.j**a:5:warning:asofrelease1.4,assertisakeyword,andmaynotbeuse
dasanidentifier
assertage<=0:"年龄有误";
^
***.j**a:5:';'expected
assertage<=0:"年龄有误";
^
1error
1warning
错误
为什么?谢谢希望大家能够帮助她。
详细问题描述及疑问:classTest
{
voidprocess(intage)
{
assertage<=0:"年龄有误";
System.out.println(age);
}
publicstaticvoidmain(String[]args)
{
newTest().process(-5);
}
}
在编译的时候j**ac***.j**a会出现
C:\>j**ac***.j**a
***.j**a:5:warning:asofrelease1.4,assertisakeyword,andmaynotbeuse
dasanidentifier
assertage<=0:"年龄有误";
^
***.j**a:5:';'expected
assertage<=0:"年龄有误";
^
1error
1warning
错误
为什么?谢谢期待您的答案,千言万语,表达不了我的感激之情,我已铭记在心
!