This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes simple questions about AWT and Assertions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "simple questions about AWT and Assertions " Watch "simple questions about AWT and Assertions " New topic
Author

simple questions about AWT and Assertions

Wenyu Deng
Greenhorn

Joined: Mar 27, 2003
Posts: 6
Anybody can tell me, what is the full name of AWT and Assertions? and what are they mean? thanks a lot.
----waiting for your feeback.
Charles Lyons
Author
Ranch Hand

Joined: Mar 27, 2003
Posts: 836
Correct me if I'm wrong, but AWT stands for Abstract Windowing Toolkit... All of the GUI components (e.g. windows and buttons) are designed to utilise native code, hence displaying like your normal windows under any OS (i.e. in Windows, they will display as normal Windows windows do [that phrase is confusing!], and under Linux they will display in a Linux-style format). Often now, many programmers use the Swing components (in package javax.swing), as they supply additional and improved components - and will always display the SAME across any platforms.
Assertions are used (as any concurrent programmer of J2SE 1.4 will tell you) to verify that certain statements that MUST BE TRUE are met, or that points in code that should never be reached are not... For example, suppose that you have a switch statement, and the int passed as the argument should match one of the cases exactly. You may use an assertion in the default case, to verify that if the code is reached, the program will terminate (as technically it should never be reached).
They may also be used to verify that a particular variable or method returns a value that MUST be correct.
Note that assertions are disabled by default, to enable backward compatibility with code that used variable names (identifiers more technically) called 'assert'. The structure of an assert statement is effectively:
assert <statement> : <message>;
If the <statement> returns the boolean value false, the program (assuming assertions enabled) will terminate, with an optional String message <message>. There are several APPROPRIATE uses of assertions, and uses which are NOT - certainly this is required information for the SCJP 1.4 exam.


Charles Lyons (SCJP 1.4, April 2003; SCJP 5, Dec 2006; SCWCD 1.4b, April 2004)
Author of OCEJWCD Study Companion for Oracle Exam 1Z0-899 (ISBN 0955160340 / Amazon Amazon UK )
Wenyu Deng
Greenhorn

Joined: Mar 27, 2003
Posts: 6
thank you, i got it.
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
Welcome to JavaRanch, Wenyu!
For more information on assertions in Java, take a look at the September 2002 JavaRanch Newsletter.


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: simple questions about AWT and Assertions
 
Similar Threads
is there any SCJP 1.4 ??
Exam for JDK1.4
Exam doubt
SCJP 1.4
Input/Output, AWT objectives for 1.4 exam?