[hotjoe.com] HotJoe Java Help Forums
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Visit java.com
Please send email if you are having login problems - see the posts below for more info.
Hotmail and Yahoo! users - please see the Hotmail post or the Yahoo! post for information on lost emails.
Hello I am very new to java and i need help  XML
Forum Index » New to Java
Author Message
zeuz101

Newbie

Joined: 09/01/2009 09:48:37
Messages: 4
Offline

Hi I need to make this easyer to read I dont understand it plz help.

<!--[if !ppt]--><!--[endif]--> int var1 = 3 * 2 / 2 – 3 + 1 % 4 -1 * 2 / 2 + 3 + 3 % 2 * 2 * 2 / 4 + 4
stdunbar

Newbie
[Avatar]

Joined: 06/22/2005 14:51:37
Messages: 849
Location: Superior, CO, USA
Offline

I'm not sure what you're asking and this looks like JavaScript but we might be able to help you anyway.

If is is JavaScript, you just need to understand Javascript operator precedence.

Thanks for using the forums at hotjoe.com
[WWW] [Yahoo!] [ICQ]
zeuz101

Newbie

Joined: 09/01/2009 09:48:37
Messages: 4
Offline

okay thank u...and that is wat i though 2 my teacher asked me that and i in java programming
so yeah
stdunbar

Newbie
[Avatar]

Joined: 06/22/2005 14:51:37
Messages: 849
Location: Superior, CO, USA
Offline

Well, the code doesn't even compile under Java without some modifications. The code:



produces:

var 1 is 10.608695652173914

Note that if this was cast to an int it would truncate the numbers to the right of the decimal place.

Thanks for using the forums at hotjoe.com
[WWW] [Yahoo!] [ICQ]
zeuz101

Newbie

Joined: 09/01/2009 09:48:37
Messages: 4
Offline

thanks you
 
Forum Index » New to Java
Go to:   
Powered by JForum 2.1.9 © JForum Team
This site run by Scott Dunbar of Xigole Systems. © 2005-2011 - Scott Dunbar
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners
hotjoe.com, xigole.com, and Scott Dunbar have no affiliation with Oracle