Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners Integer display problem

Have Programming Question? Ask it here!
 
 
 


dipak kumar
Integer display problem
1 Answer(s)      2 years and 9 months ago
Posted in : Java Beginners


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.


Advertisement
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... it contains same checkboxes. 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
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
display
display  please tell me how to display the content from database.. if we click on any image using servlets/jsp...please
Integer exception in java
. if the user enters integer it will display the number which the user have... Integer exception in java       The integer class is a wrapper for integer value
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
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
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
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
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.  
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... is the example code: String s =request.getParameter("myvariable"); Integer i
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
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
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: The following program takes an integer type data at the console
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: This program helps you
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: This program helps
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
Convert Character into Integer
Convert Character into Integer   ... into a integer. The java.lang package convert provides the facility to convert the character data into an integer type. Description of code: This program
Java Reverse integer array
Java Reverse integer array In this tutorial, you will learn how to reverse integer array. Here, we have created a method to reverse an array which has been passed as a parameter and returns a new array with all the elements in reverse
Use char variable as integer
Description: Here in this example you will see how a char variable works like a integer. The char variable works with pre and post increment operators. Code: public class CharInt {   
Convert an Integer into a String
Convert an Integer into a String       In this section, you will learn to convert an integer... an integer number at  the console and it converts it into a string format
How can print integer in method
How can print integer in method   a method call process public process(int jobid,int remain){ } how to print int jobid ,int remain in for loop jobid in proc[0],remain in proc[1],both show in text file how to print proc[0
Convert a String into an Integer Data
Convert a String into an Integer Data In this section you will learn to convert a string type of data to integer type data. Converting string to integer and integer to string is a basic task in java programming language because
retreive integer data from database
retreive integer data from database  i made a table named result having two fields 1>rollno 2>marks i creates a gui where i use a textfield... as an integer(rollno) and the marks associated with that must be displayed.i write
Convert a String into an Integer Data
Convert a String into an Integer Data  ... a string type data into an integer type. The java.lang package provides the functionality to convert the string type data into an integer type data. Code
Convert Integer to Float
Convert Integer to Float       In this section, you will learn to convert an integer type data into a float. The following programs helps you in converting an integer
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
Convert Float to Integer
Convert Float to Integer      ... into an integer.  Code Description: In this program, first of all we declare a float....  For converting the float type value into an integer, we simply applied
How to change object item to integer item
How to change object item to integer item  How to change objectitem to integer item?thankyou
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
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)  
How does Java handle integer overflows and underflows?
How does Java handle integer overflows and underflows?   hi, How does Java handle integer overflows and underflows? Thanks
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
PHP Integer Data Type
Learn PHP Integer Data type: In PHP integers can be decimal which is a normal..., and to denote a hexadecimal number use 0x before the number. Maximum size of the integer data type is platform dependent. Usually the size of integer is 2 million in 32
Display image
Display image  How to Pass image from html to jsp and display... the html page to jsp page and display it. 1)page.html: <%@ page language="java" %> <HTML> <HEAD><TITLE>Display file upload form
Advertisements
 

 

 

DMCA.com