Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

Intermediate Java programming

Roy W. Miller (roy@roywmiller.com), Programmer, Independent
Roy Miller is an independent software development coach, programmer, and author. He began his career at Andersen Consulting (now Accenture), and most recently spent three years using Java professionally at RoleModel Software, Inc. in Holly Springs, NC. He has developed software, managed teams, and coached other programmers at clients ranging from two-person start-ups to Fortune 50 companies.

Summary:  The Java™ language provides most of what professional programmers expect to see in a language, and even in an object-oriented language. Beyond the basics, though, the Java language provides some useful tools for creating sophisticated programs. This tutorial will introduce you to some of these more advanced Java language features commonly seen on typical Java technology development projects.

Date:  13 Jan 2005
Level:  Introductory PDF:  A4 and Letter (159 KB | 51 pages)Get Adobe® Reader®

Activity:  23798 views
Comments:  

Wrap-up

Summary

We've covered a significant portion of the Java language in the "Introduction to Java programming" tutorial (see Resources) and this tutorial, but the Java language is huge and a single, monolithic tutorial (or even several smaller ones) can't encompass it all. Here's a sampling of some areas we did not explore at all:

Topic

Brief description

Threads Having a program that does only one thing at a time can be useful, but most sophisticated Java language programs have multiple threads of execution that run simultaneously. For example, printing or searching tasks might run in the background. The class Thread and related classes in java.lang can give you powerful and flexible threading capability in your programs. developerWorks hosts many good resources on threading in your Java code, but a good place to start would be with the "Introduction to Java threads" and "Concurrency in JDK 5.0" tutorials and this series of articles by Brian Goetz.

Reflection One of the more powerful aspects of the Java language (and often one of the most mind-bending) is reflection, or the ability to see information about your code itself. The package java.lang.reflect includes classes like Class and Method that let you inspect the structure of your code. For example, you can find a method starting with get, then call it by calling invoke() on the Method object -- very powerful. Part 2 of the "Java programming dynamics" series by Dennis M. Sosnoski talks about using reflection.

NIO Since JDK 1.4, the Java language has incorporated some more sophisticated I/O capabilities, based on a completely new API called new I/O, or NIO for short. The principal difference is that traditional Java language I/O is based on streams (as we've already discussed), while NIO is based on a concepts called block I/O, channels, and buffers. This block I/O tends to be more efficient than sending single bytes one at a time through a stream. The drawback is that NIO can be conceptually difficult. "Getting started with new I/O (NIO)" by Greg Travis is an excellent tutorial on the subject.

Sockets Your Java language programs can communicate with virtually any program on an IP-enabled device. All you need to do is open a socket connection to an IP address and port on that device. The Java language Sockets API facilitates that. See the "Java sockets 101" tutorial by Roy Miller and Adam Williams for an introduction to the API. The "Using JSSE for secure socket communication" tutorial by Greg Travis shows you how to make your socket communication secure.

Swing The Java language includes extensive support for GUI development, in the form of Swing. The Swing set of APIs includes classes for widgets and other elements to create full-featured user interfaces. There are several important developerWorks resources related to Swing, but a good place to start is the introductory article "The Java 2 user interface" by Matt Chapman. The Magic with Merlin column by John Zukowski addresses more recent changes and updates to Swing. John also hosts the Client-side Java programming discussion forum, so you can get assistance with Swing programming there, too. The "Migrate your Swing application to SWT" tutorial discusses how to migrate from Swing to IBM's SWT, a lighter-weight but still powerful alternative.

JNI When your Java program needs to communicate with another program written, for example, in C, the Java language gives you a way to do that: The Java Native Interface (JNI). This API lets you translate Java language method calls into calls to C functions (for interacting with the OS and such). The developerWorks "Java programming with JNI" tutorial discusses the mechanics of JNI with Java, C, and C++ code.

RMI The Java language Remote Method Invocation (RMI) API allows a Java language program in one process or on one machine to access another Java language program running in another process and/or on another machine. In other words, RMI supports distributed method calls between programs running in different Java VMs. Brad Rubin's "Java distributed objects: Using RMI and CORBA" tutorial gives a solid introduction to RMI, and discusses RMI and CORBA together. You should also check out this article by Edward Harned to learn why RMI is not an off-the-shelf application server.

Security The Java language includes sophisticated security APIs to support authentication and authorization. How can you be sure that those who use your program have permission to do? How can you protect information from prying eyes? The security APIs can help. developerWorks offers an abundance of content related to Java security. Here are just a few: Java security discussion forum hosted by John Peck, a veteran Java programmer and security expert; "Java authorization internals" by Abhijit Belapurkar; and "Java security, Part 1: Crypto basics" and "Java security, Part 2: Authentication and authorization" both by Brad Rubin .

9 of 11 | Previous | Next

Comments



Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Java technology
ArticleID=131623
TutorialTitle=Intermediate Java programming
publish-date=01132005
author1-email=roy@roywmiller.com
author1-email-cc=

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere).

My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).