如果识别出9,则无法识别09 [英] 09 is not recognized where as 9 is recognized

查看:137
本文介绍了如果识别出9,则无法识别09的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用石英作为schedulling。

I am using quartz for schedulling.

TriggerUtils.getDateOf(0,40,18,09,06);

它接受5个参数。 (秒,分钟,小时,天,月,月)。

it accept 5 parameter. (seconds, minutes, hours, daysOfMonth, month).

当我将第四个参数传递为09时。 Eclipse给我错误int类型的文字八进制09(数字9)超出范围。

When i pass fourth parameter as "09". Eclipse give me error "The literal Octal 09 (digit 9) of type int is out of range ".

但当我将第四个参数传递为9时而不是09,它有效。

任何人都可以解释我这个错误吗?

Can anyone explain me this error?

推荐答案

在java中,如果要定义一个整数,则前导0将表示您在八进制中定义一个数字

In java, if you are defining an integer, a leading '0' will denote that you are defining a number in octal

int i = 07; //integer defined as octal
int i = 7; // integer defined as base 10
int i = 0x07; // integer defined as hex
int i = 0b0111; // integer defined as binary (Java 7+)

这篇关于如果识别出9,则无法识别09的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆