Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6968973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:31:18+00:00 2026-05-27T16:31:18+00:00

public static void main (String[] ses) { System.out.println(740 * (24 * 60 * 60

  • 0
public static void main (String[] ses) {
    System.out.println(740 * (24 * 60 * 60 * 1000));
}

tried it on google, it gave a different result also on a scientific calculator.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T16:31:18+00:00Added an answer on May 27, 2026 at 4:31 pm

    Because the result is 63,936,000,000 which is more than you can store in a Java integer (which by default those are because none of them are prefaced with L). An integer can only store 4 bytes (32 bits) and that number would require 36 bits. It then overflows, essentially only using the final (first?) 32 bits of the result. Because the first (last? depends on how you look at it) of these bits determines if a number is signed or not, when the number is again actually treated like an integer, it is displayed as negative.

    This is particularly useful for calculating hashes, as the only logical alternative I see is to make all numbers over the max value equal to the max value, which I think we can agree is a poor choice.

    If you made it System.out.println(740L * (24 * 60 * 60 * 1000)); it should use a long which can store much larger numbers.

    You’ll note I have question marks through this – bytes are bytes, and bits are bits. What really matters is how you interpret them. There is contention in the software development community what it really means to be the first digit, bit, or byte. Consider “1234” as a number. Is 1 the first digit? Most common folk would agree it is, because it’s written first when we look at it. But others would consider 4 to be the first digit, because it’s convenient to do so for calculation purposes. (Consider adding – where do you add first? Wouldn’t that be the first number?)

    So that’s why I appear to be indecisive as I say first/last – I just want to make it clear what’s going on.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

code: public class Main{ public static void main(String[] a){ long t=24*1000*3600; System.out.println(t*25); System.out.println(24*1000*3600*25); }
class D { public static void main(String args[]) { Integer b2=128; Integer b3=128; System.out.println(b2==b3);
public static void main(String[] args) { System.out.println(fun(2,3,4)); } static int fun(int a,int b,int c)
public static void main (String[] args) { System.out.println(factorial(5)); } public int factorial(int n) {
public class Test{ public static void main(String[] arg){ System.out.println(Alexander The Great); } } In
public static void main(String args[]) { String sub=0110000; String a[]=sub.split(); System.out.println(Arrays.toString(a)); } I get
public static void main(String[] args) { int count, innerCount; for(count=0;count<=3;count++) { System.out.println(Count is +
public class Guess { public static void main(String[] args){ <sometype> x = <somevalue>; System.out.println(x
public static void main(String[] args) { boolean t=true; System.out.println(Before return); if(t) return; System.out.println(not execute);
public class simple { public static void main(String[] args) { try { System.out.print(hello );

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.