Integer display problem

Integer display problem

class Bean{ int n1,n2; public Bean(){ } public Bean(int n1, int n2){ this.n1=n1; this.n2=n2; } public static void main(String arg[]){ Bean b1=new Bean(010,50); System.out.println("value of n1 is:"+b1.n1); System.out.println("value of n2 is:"+b1.n2);

} }

In above program value of n1 should display 10. But it is displaying 8. what is reason behind it.

View Answers

July 22, 2011 at 1:44 AM

Here 010 is considered as an octal literal leading 0 is used to represent Octal values hence 010 in Octal means 8.

also u can check it by putting 09 at place of 010

compiler error coz 9 doesnt comes in Octal representation









Related Tutorials/Questions & Answers:
Integer display problem
Integer display problem  class Bean{ int n1,n2; public Bean(){ } public Bean(int n1, int n2){ this.n1=n1; this.n2=n2; } public...); } } In above program value of n1 should display 10. But it is displaying 8. what
Display Problem
Display Problem  i am creating a small window application , i want to fetch data from ms-access(db) and want to display it on tables. what options are there to show result on table. is CSS helpfull
Advertisements
i want display integer number in a string of statement
i want display integer number in a string of statement  i want display integer number in a string of statement
iterator display problem - Struts
iterator display problem   in action class i store database data in arrraylist but after success how can i display those data in jsp page using... friend, Code to help in solving the problem : Iterator Tag
Problem to display checkbox item
Problem to display checkbox item  Hi, Following is my code: <...; I want to display records, when i click on submit button or any dumy button... checkboxes.ADS_TO_REPLACE_5 So, from your above code, i can display selected
Jfreechart chart display problem
Jfreechart chart display problem  Using JSP and Jfreechart displays the chart fine on an internal browser in eclipse but doesnt display it on Chrome...(request.getParameter("q")); String query="select dateof,dayinprice,company from stockprice
Problem with display of images in applets - Applet
Problem with display of images in applets  Hi all, When I run... in figuring out the problem....  Hi frined, import java.applet.*; import..., this); } } --------------------------------------- Display image in Java Applet
select Query result display problem
select Query result display problem  Hi, String SQL_QUERY ="from Cc"; Query query = session.createQuery(SQL_QUERY); for(Iterator it=query.iterate();it.hasNext();){ Object[] row = (Object[]) it.next
JComboBox Display Problem - Java Beginners
JComboBox Display Problem  I am create one program that contain two combo boxes. If first combo box i am display all date. If i select one date from first combo box then the second combo box display some dates based on first
display records with images problem - JSP-Servlet
display records with images problem  hello, i am developing HR application whereby i want to display employee records and their pictures on web... with a unique id. Also i wrote i jsp that link to servlet in order to display
this code will be problem it display the error again send jsp for registration form
this code will be problem it display the error again send jsp for registration form  I AM ENTERING THE DETAILS OFTER IT DISPLAY THE ERROR PLEASE RESEND THE CODE org.apache.jasper.JasperException: java.lang.NumberFormatException
this code will be problem it display the error again send jsp for registration form
this code will be problem it display the error again send jsp for registration form  I AM ENTERING THE DETAILS OFTER IT DISPLAY THE ERROR PLEASE RESEND THE CODE org.apache.jasper.JasperException: java.lang.NumberFormatException
display
display  write a program that determines the limit of an integer
display
display  write a program that determines the limit of an integer
display
display  please tell me how to display the content from database.. if we click on any image using servlets/jsp...please
integer to string
integer to string  i have to develop a program which convert integer into character from 1 to 10,000 if we input 1 then it give output 'one' n so on till 'ten thousand' kindly give me the codes plzplz sir........   Have
java program (integer/decimal) - Java Beginners
java program (integer/decimal)  Accept a number from the user as command line arguments. The number could be an integer or decimal value. ? Display the absolute value of the input number ? Display the rounded off value
Integer exception in java
an exception error. if the user enters integer it will display the number which... Integer exception in java       The integer class is a wrapper for integer value
find the given input is integer or string
find the given input is integer or string  simple coding for to check the given input value is integer or no.If the given value is integer display "Value is integer" otherwise "Value is not a integer"?   class
convertig biginteger value into integer
class variable into integer like BigInteger p = BigInteger.valueOf(10); now i... this problem but i found no solution so please somebody help me to solve this problem .I am the beginner in java   import java.math.*; class
accept integer from user
accept integer from user  Write an Java application that accepts 100 integer numbers from a user. The input should be in the range of 1-200. Error.... Based on this input, the program will display the number of integers
Integer value to string - Swing AWT
Integer value to string  How can we convert an integer type into String ,so that we can select some integers from list and sum them and add to a textfield. Here the problem is when we are going to add Integer to TextField.  
ModuleNotFoundError: No module named 'integer'
ModuleNotFoundError: No module named 'integer'  Hi, My Python... 'integer' How to remove the ModuleNotFoundError: No module named 'integer... to install padas library. You can install integer python with following command
Initializing Integer Variable issue?
problem is my integer variables (number0 - number6). It is forcing me to initialize...Initializing Integer Variable issue?  My program is supposed to take a phrase like you'd see on a TV commercial, for example: "Call 1-800-GETLOAN now
swap two integer arrays
swap two integer arrays  int [] array1 = {1,2,3,4,5} int [] array2 = {6,7,8,9,10} how can we swap the values of bith integer arrays results like this array1 = {6,7,8,9,10} array2 = {1,2,3,4,5
swap two integer arrays
swap two integer arrays  int [] array1 = {1,2,3,4,5} int [] array2 = {6,7,8,9,10} how can we swap the values of bith integer arrays results like this array1 = {6,7,8,9,10} array2 = {1,2,3,4,5
swap two integer arrays
swap two integer arrays  int [] array1 = {1,2,3,4,5} int [] array2 = {6,7,8,9,10} how can we swap the values of bith integer arrays results like this array1 = {6,7,8,9,10} array2 = {1,2,3,4,5
Display Tag
Display Tag  Hi Here is My code, There is problem At line no.3, where i want to display two fields in one column but it gives error.. Please any one knows the solution must reply Thanks In Advance
Display Tag
Display Tag  Hi Here is My code, There is problem At line no.3, where i want to display two fields in one column but it gives error.. Please any one knows the solution must reply Thanks In Advance
get integer at run time
get integer at run time  how to get integer value at run time in j2ee using servlets   Hi, You can get the value from request parameter... Here is the example code: String s =request.getParameter("myvariable"); Integer
Reverse integer array program
Reverse integer array program  Been tasked with the following question: Write a method that accepts an integer array and returns a new array with all the elements in reverse order. For example, if the input array is [2, 4, 6, 8
problem in coding
problem in coding  i have a following code which display the contents... FileReader("myprogram1.java"); not possible to display the content...); fr.close(); possible to display the content of myprogram.txt
javascript integer to string conversion
javascript integer to string conversion  How to Javascript Integer to String Conversion   <script type="text/javascript"> /** * print out the value and the type of the variable passed
in php installation problem ?
in php installation problem ?   php installation in 7th step did not display y/n dialog box how to solve the problem
Display Configurations
Display Configurations   The year is 2136. A lot of things have changed but BITS Pilani still exists. The display technology used now is a WASDLED screen. This display technology consists of a configuration matrix containing
ModuleNotFoundError: No module named 'crosscompute-integer'
ModuleNotFoundError: No module named 'crosscompute-integer'  Hi...: No module named 'crosscompute-integer' How to remove the ModuleNotFoundError: No module named 'crosscompute-integer' error? Thanks   Hi
ModuleNotFoundError: No module named 'crosscompute-integer'
ModuleNotFoundError: No module named 'crosscompute-integer'  Hi...: No module named 'crosscompute-integer' How to remove the ModuleNotFoundError: No module named 'crosscompute-integer' error? Thanks   Hi
ModuleNotFoundError: No module named 'crosscompute-integer'
ModuleNotFoundError: No module named 'crosscompute-integer'  Hi...: No module named 'crosscompute-integer' How to remove the ModuleNotFoundError: No module named 'crosscompute-integer' error? Thanks   Hi
ModuleNotFoundError: No module named 'crosscompute-integer'
ModuleNotFoundError: No module named 'crosscompute-integer'  Hi...: No module named 'crosscompute-integer' How to remove the ModuleNotFoundError: No module named 'crosscompute-integer' error? Thanks   Hi
ModuleNotFoundError: No module named 'integer_encoding'
ModuleNotFoundError: No module named 'integer_encoding'  Hi, My... named 'integer_encoding' How to remove the ModuleNotFoundError: No module named 'integer_encoding' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'integer-gantt'
ModuleNotFoundError: No module named 'integer-gantt'  Hi, My... 'integer-gantt' How to remove the ModuleNotFoundError: No module named 'integer-gantt' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'integer-lang'
ModuleNotFoundError: No module named 'integer-lang'  Hi, My Python... 'integer-lang' How to remove the ModuleNotFoundError: No module named 'integer-lang' error? Thanks   Hi, In your python
Display patterns
Display patterns  Write a test program that read an integer n and call a method to display a pattern as follows: 1 2 1 3 2 1 4 3 2 1 ... n n-1 ... 3 2 1 The method header is public static void displayPattern(int n)   
Display patterns
Display patterns  Write a test program that read an integer n and call a method to display a pattern as follows: 1 2 1 3 2 1 4 3 2 1 ... n n-1 ... 3 2 1 The method header is public static void displayPattern(int n)  
Convert Decimal to Integer
Convert Decimal to Integer      ... into an integer. The java.lang package provides the functionality to convert a decimal number to an integer type number. Description Code:ADS_TO_REPLACE_1
problem i coding
problem i coding  i have a problem in coding a combobox containing a number of *.java program on click one of them that program should compile and run and display the result in other window
Convert Integer to Double
Convert Integer to Double        In this section, you will learn to convert an integer... for converting an integer type data into a double. Code Description:ADS_TO_REPLACE_1
Convert Hexadecimal number into Integer
to convert hexadecimal data into integer. The java.lang package provides the functionally to convert the hexadecimal data into an integer type data.  Code Description:ADS_TO_REPLACE_1 The following program takes an integer type data
The largest integer among the X number
The largest integer among the X number  Write an application program... information : a) The largest integer among the X number of integers keyed in b) The smallest integer among the X number of integers keyed in The program
php problem
php problem  Hello!! I have a problem ,i want to display the data of a single row in my database,this is the code: <?php</p> include 'connectMySql.php'; $username=$row['username']; if(! $conn ) { die('Could

Ads