This week's book giveaway is in the Agile and Other Processes forum. We're giving away four copies of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java and have Dr. Raoul-Gabriel Urma & Richard Warburton on-line! See this thread for details.
when i print double sometimes it prints in exponential format sometimes in normal way.. what exactly is the rule behind this printing? what is the largest number that will be printed in the normal way ?
If you just print the number without specifying how it should be formatted, Java just uses the default formatting. If you don't want that, specify the formatting yourself.
If you are using Java 1.5 (or newer) you can use System.out.printf(...) with a format string to specify how you want your number formatted.
If you're using Java 1.4 (or older) you can use class java.text.DecimalFormat.
To answer your original question about the default formatting: you can find the answer in the API documentation of method java.lang.Double.toString(double), it explains in detail how the default formatting works.