Core Java 2. Advanced Features by Horstmann C.S., Cornell G.

By Horstmann C.S., Cornell G.

* The skilled developer's complicated consultant to the Java 2 platform-fully up-to-date for JDK 1.3 liberate and JDK 1.4 free up, usual variation. * much more powerful, real-world code samples than ever earlier than! * New and made over insurance: XML, protection, networking, multithreading, collections, distant items, JDBC API, JavaBeans part structure, Swing, and lots more and plenty extra * CD-ROM contains the entire code examples, uniqueness for Java, free up 2.0, neighborhood variation, and the present model of the Java 2 SDK, typical variation for home windows, Solaris OE (SPARC/x86), and Linux.The no 1 complex consultant for severe programmers-fully up-to-date for JDK 1.3 liberate and JDK 1.4 release.An critical spouse to the best-selling middle Java 2, Vol. I - basics (0-13-089468-0), center Java 2, quantity II: complex gains is now to be had in a revised and accelerated 5th version. It supplies an identical real-world tips you want to clear up even the main demanding programming difficulties and provides an all-new bankruptcy on XML and Java, plus completely made over assurance of many complicated features-from collections to local equipment, safeguard to Swing.Cay Horstmann identifies the issues skilled Java platform builders come upon usually, and provides insightful, expert-level information for addressing them-together with much more of the powerful, pattern code that experience made center Java a global bestseller for 5 directly years. you are going to achieve new insights into networking, distant gadgets, JDBC API, internationalization, and an entire lot more.For skilled programmers, center Java 2, quantity 2: complex positive aspects presents the solutions that they should take complete good thing about the facility of Java know-how and to get the task performed as successfully as possible.State-of-the-art info for complex Java expertise improvement, together with: * completely up to date assurance of multithreading, collections, and networking * thoroughly revised assurance of distant gadgets * specified new bankruptcy on XML and Java * subtle new strategies for using JavaBeans(tm) part structure * complicated GUI-building recommendations leveraging either Swing and AWT

Show description

Read Online or Download Core Java 2. Advanced Features PDF

Best programming: programming languages books

Extra info for Core Java 2. Advanced Features

Sample text

185. 186. 187. 188. 189. 190. 191. 192. 193. 194. 195. 196. 197. 198. 199. 200. 201. 202. 203. 204. 205. } 207. Thread • Advanced Features Thread() By ViTo @ RoR & BT Core Java 2, Volume II Advanced Features constructs a new thread. You must start the thread to activate its run method. • void run() You must override this function and add the code that you want to have executed in the thread. • void start() starts this thread, causing the run() method to be called. This method will return immediately.

Start(); CAUTION Do not call the run method directly—start will call it when the thread is set up and ready to go. Calling the run method directly merely executes its contents in the same thread—no new thread is started. Beginners are sometimes misled into believing that every method of a Thread object automatically runs in a new thread. As you have seen, that is not true. The methods of any object (whether a Thread object or not) run in whatever thread they are called. A new thread is only started by the start method.

Public class BounceThread By ViTo @ RoR & BT Core Java 2, Volume II Advanced Features 11. { 12. public static void main(String[] args) 13. { 14. JFrame frame = new BounceFrame(); 15. EXIT_ON_CLOSE ); 16. show(); 17. } 18. } 19. 20. /** 21. The frame with canvas and buttons. 22. */ 23. class BounceFrame extends JFrame 24. { 25. /** 26. Constructs the frame with the canvas for showing the 27. bouncing ball and Start and Close buttons 28. */ 29. public BounceFrame() 30. { 31. setSize(WIDTH, HEIGHT); 32.

Download PDF sample

Rated 4.37 of 5 – based on 36 votes