Learning Java by working examples

10-May-05

One good way to learn Java is to study working examples of source code. The following are some good sites that provide a large amount of Java source code.

  • Collections of Java Source code: It contains a lot of links to similar sites.
  • JavaBoutique: Besides providing huge amount of applets examples, it is also a good resource site for learning Java and other programming languages.
  • Planet Source Code: A large public source code database in 11 languages (VB, Java/Javascript, C/C++, ASP, SQL, Perl, Delphi, PHP, Code Fusion, .Net and LISP).
  • Servlet Examples: Servlets examples from various sources that are collected and implemented by Jeff Schmitt.
  • Java Samples by Neal: It provides a number of sample Java classes that Neal has written. It also contains links to other places containing Java sample codes.

O’Reilly CodeZoo

28-Apr-05

O’Reilly CodeZoo is a new site by O’Reilly Network, which was launched on April 2005. Its slogan is Find good code. Use it quickly. To quote:

CodeZoo exists to help you find high-quality, freely available, reusable components, getting you past the repetitive parts of coding, and onto the rest and the best of your projects. It’s a fast-forward button for your compiler.

Static Analysis of Java Programs with PMD

11-Mar-05

PMD is an open source tool that analyzes Java source code to find potential bugs.PMD scans Java source code and looks for potential problems like:

  • Empty try/catch/finally/switch blocks
  • Unused local variables, parameters and private methods
  • Empty if/while statements
  • Overcomplicated expressions - unnecessary if statements, for loops that could be while loops
  • Classes with high Cyclomatic Complexity measurements

PMD can also be integrated with Ant for automatic source-code checking, and plug-ins exist for most major IDEs and programmer’s editors.

I recommend an Elliotte Rusty Harold’s article titled Zap bugs with PMD. It is an introductory reading about installing, configuring, and running PMD.

Test-Driven Development, Java and JUnit

10-Mar-05

This is an article written by Mike Clark on January 2004 titled “A Dozen Ways to Get the Testing Bug in the New Year”.

The article can be read and printed through the this URL.

(more…)

A J2ME FAQ

28-Feb-05

A J2ME FAQ is an article by Kevin Boone on his personal website. Areas covered in this FAQ include: J2ME technologies, J2ME development procedures and tools, MIDP/CLDC programming, File and data management, and Networking and communications. The article is not too long and is good and concise.

Working with J2ME

24-Feb-05

It is an article from TheServerSide.com, written by Dan Moore, and posted in February 2005. Click this URL to read it.

A cell phone application can be a good fit for certain types of problems, especially those requiring timely data access away from typical internet connectivity. Java 2 Micro Edition (J2ME) is one of the leading platforms for developing such solutions.

This paper explores the various facets of building a J2ME application. It assumes a working knowledge of Java. The focus is on a MIDP 1.0/CLDC 1.0 application that depends heavily on network access.