₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,331,317 members, 8,449,723 topics. Date: Wednesday, 22 July 2026 at 09:18 AM

Toggle theme

Explain This Code Please: - Programming - Nairaland

Nairaland ForumScience/TechnologyProgrammingExplain This Code Please: (916 Views)

1 Reply

Explain This Code Please: by saragondla(op): 5:42am On Nov 24, 2009
public class B {

public int add()
{
return 011;
}
public static void main(String[] args)
{
B b1=new B();
//System.out.println(!new Boolean(false));
System.out.println(b1.add());
}

here output will give :9 . how it will come like this please explain me any one,

}
Re: Explain This Code Please: by logica(m): 7:46am On Nov 24, 2009
The int value 011 represents an octal value. In Java, any integral value that starts with 0 is assumed to be in the octal system (base-cool. Please go read about literal values in Java.  011 converted to the standard decimal (base-10) is 9, which is the default numerical system except otherwise specified, therefore 9 is printed.
1 Reply

5,000 Naira For Someone Who Can Reverse This CodeNeed Help With This CodePlease Help With These Code Please234

Programmers In The House,need Your Opinions Plz!Class/meta ClassCritical Success Factors To Know When Building Mobile Website And App