4 Replies Last post: Jan 30, 2013 6:59 PM by Zemian Deng  
Zemian Deng Novice 122 posts since
Nov 8, 2012
Currently Being Moderated

Jan 29, 2013 7:46 AM

Got IDE red mark errors while JDK will compile fine.

Hi there,

 

I understand below is not good code, but JDK compiler did not complains, however the IntelliJ won't leave it alone and labeled it with a red mark that I can not remove!

 

public class test {
     public static void main(String[] args) {
          Integer i = 0;
          System.out.println((i++).toString());
     }
}

 

It says "toString()" is not defined.

 

Thanks,

Zemian

Ian K Newbie 7 posts since
Jun 26, 2006
Currently Being Moderated
Jan 29, 2013 3:49 PM in response to: Zemian Deng
Re: Got IDE red mark errors while JDK will compile fine.

Thats a good one - Can confirm it; The compiler is the one at Fault though..

Greg Gigon Newbie 21 posts since
Jan 11, 2013
Currently Being Moderated
Jan 29, 2013 3:57 PM in response to: Zemian Deng
Re: Got IDE red mark errors while JDK will compile fine.

I think i++ returns int not Integer. Seems right to me that it indicates an error.

More Like This

  • Retrieving data ...