CrazyEngineers Forum - Computer Science & IT Engineering |
Java: double to int automatic conversion Posted: 20 Feb 2011 08:27 AM PST Code: int i = 1; This code is error free and the result is an integer. Code: int i = 1; Edit: Had been searching for answer the whole day and someone finally answered it. A compound assignment expression of the form E1 op= E2 is equivalent to E1 = (T)((E1) op (E2)), where T is the type of E1, except that E1 is evaluated only once. from: http://java.sun.com/docs/books/jls/t...ions.html#5281 |
You are subscribed to email updates from CrazyEngineers Forum - Computer Science & IT Engineering To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google Inc., 20 West Kinzie, Chicago IL USA 60610 |
No comments:
Post a Comment