473,396 Members | 1,987 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Java double data type problem

can anyone explain me the output of the following program :
Thanks in advance

// program

Expand|Select|Wrap|Line Numbers
  1. class No_System_Demo
  2. {
  3.   public static void main(String[] n) 
  4.   {
  5.     double d=020;    // octal no 20 stored
  6.     System.out.println("d=" +d);    // output will be in decimal number system and is 16.0 and thats fine
  7.  
  8.  
  9.    double d1=020.0;   // octal no's can have a decimal so     the same no 20 or say 20.0 is stored
  10.    System.out.println("d1=" +d1);  // but this time why the output isn't in decimal number system, it displays 20.0 instead of 16.0
  11.  
  12.    }
  13. }
  14.  
Jul 29 '11 #1
0 1243

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Derk | last post by:
I have an VB App that reads an Excel Sspreadsheet and it seems to having problems determining the data type of a column. The column in question has alpha numeric content eg S001, B123 or 1234. I am...
1
by: Lukelrc | last post by:
Hi all. I'm having trouble connecting to my sql server database correctly beacause of value type problems, specifically the date fields. When i try and run the page i get the follwoing error: ...
3
by: kieran | last post by:
Hi, I have a form which is submitting into a sql server db. i have one of the fields set to ntext which says length of 16. when i insert info, it only sumbits about a paragraph and when i pull...
0
by: Olav | last post by:
I'm trying to use Python / COM to do some drawing automation. Here is a simple code example: This code uses a object made by the Opendwg-org. Autocad has a similar object with the same methods...
0
by: Roy | last post by:
Hi all, There is a column (col1) in Access data base that is adouble data type. In vb.net when I try to set a row filter for a view based on its table as: Dim dv As New DataView(MyDataTable)...
2
by: Savas Ates | last post by:
I have a field in my table which has currency values like this 41.2 10 24.12 in my vb.net application i have a variable which i assigned as decimal Dim mymoney as Decimal mymoney...
0
by: selacika | last post by:
Hi all; My question is about how to get non-font information part of a field of text data type using an sql sentence. Shortly how to get pure info from a text data type field. Example: Value of...
1
by: sangig | last post by:
hi forum, can any body help me out with the Java equivalent data type for MSSQL IMAGE data type? Thanks Sangig
2
by: SDStoic | last post by:
Hi there... I have an Oracle 9.2 table with several columns having an "NCLOB" data type. I cannot change the data type on the database. When attempting to query this linked table without...
6
by: John Moore | last post by:
My mysql data type is double(16,2) with '0.00' specified as default. These represent dollars and cent amounts. My question is: How do I perform simple mathematical operations on these money...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.