Help!
Author |
Message |
sh4dow
|
Posted: Sat Mar 28, 2009 3:27 pm Post subject: Help! |
|
|
Hi guys, can you explain to me what the following codes do. In case you're wondering, I am planing on using this for ym calculator . Thank You for your help.
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
And
String cmd = evt.getActionCommand();
if ('0' <= cmd.charAt(0) && cmd.charAt(0) <= '9' || cmd.equals(".")) { |
|
|
|
|
|
Sponsor Sponsor
|
|
|
DemonWasp
|
Posted: Sat Mar 28, 2009 7:15 pm Post subject: RE:Help! |
|
|
The import directive tells the JVM what classes it should include for use. In this case, you're including something called WindowAdapter and WindowEvent from the AWT framework.
To figure out the second command, all you should need to know is some basic programming, and that:
&& means "boolean and" - returns true if and only if the thing to the left and the thing to the right are BOTH true
|| means "boolean or" - returns true if and only if either of the thing to the left and the thing to the right are true, or both.
You should also know about http://java.sun.com/javase/6/docs/api/ |
|
|
|
|
|
sh4dow
|
Posted: Sat Mar 28, 2009 9:11 pm Post subject: RE:Help! |
|
|
Thank You very much Demon Wasp . |
|
|
|
|
|
|
|