Module 1 Study Guide
Module 1 Study Guide
History
Java language, originally called the ‘Oak’, was developed by James Gosling
at Sun Microsystems, which is now a subsidiary of Oracle Corporation, and
released in 1995 as a core component of Sun Microsystems' Java platform.
It has derived much of its syntax from C and C++ but has a simpler object
model and fewer low-level facilities.
Features of Java:
1. Simple, Object-oriented, and Familiar
Java can be programmed without extensive programmer
training while being attuned to current software practices.
The needs of distributed, client-server based systems coincide
with the encapsulated, message-passing paradigms of object-
based software.
It looks like C++ as far as possible results in it being a familiar
language, while removing the unnecessary complexities of C++.
2. Robust and Secure
It provides extensive compile-time checking, followed by a
second level of run-time checking
Java technology is designed to operate in distributed
environments, which means that security is of paramount
importance
3. Architecture Neutral and Portable
Java technology is designed to support applications that will be
deployed into heterogeneous network environments.
To accommodate the diversity of operating environments, the
Java compiler product generates bytecode – an architecture
neutral intermediate format designed to transport code
efficiently to multiple hardware and software platforms. The
interpreted nature of Java technology solves both the binary
distribution problem and the version problem; the same Java
programming bytecodes will run on any platform.
4. High Perforrnance
The automatic garbage collector runs as a low priority
background thread, ensuring a high probability that memory is
available when required, leading to better performance.
5. Interpreted, Threaded, and Dynamic
The Java interpreter can execute the bytecodes directly on any
machine to which the interpreter and run-time system have
been ported.
Java technology’s multi-threading capability provides the
means to build applications with many concurrent threads of
activity. Multi-threading thus results in a high degree of
interactivity with end users.
While Java compiler is strict in its compile-time static checking,
the language and run-time system are dynamic in their linking
stages.
Java Editions:
J2SE: Java 2 Standard Edition
J2EE: Java 2 Enterprise Edition
J2ME: Java 2 Micro Edition
The Java source code (.java file) is normally compiled to produce the
bytecode file (.class file) which is normally interpreted by the Java virtual
machine (JVM).
NetBeans Features
• Environment: easily configured user interface and a modular architecture
extensible with additional plugins.
• Project System: support for multiple source roots, easy management of
libraries, easily ported to other environments, all based on Apache Ant.
• Web Development: Web Application project type, Supports the J2EE 1.3
and 1.4 standards with web application build support based on Apache Ant.
• Enterprise Java Beans (EJB) Development: easy to create and deploy and
import java beans.
• Web Services Development: wizards for creating web services and web
services clients, providing the basic (java/wsdl) code needed, and easy to
use testing tools of existing web services.
• Java 2 Platform, Micro Edition (J2ME) MIDP development: visual design
editor with end-to-end support for enterprise applications.
• Code Editor: Syntax highlighting for Java, XML, HTML, CSS, JSP and IDL, full
support of new JDK 1.5 features, live parsing/error marking, popup javadoc,
code completion, and fast class importing.
• Refactoring: renaming, changing and moving of various objects, field
encapsulation and usage finding.
• Award Winning Debugger: Language independent debugger core, variable
modification and watches, various breakpoints and “Fix and Continue”
mechanism.
• GUI Builder: fully WYSIWYG designer with "Test Form" feature, extensible
Component Palette pre-installed Swing and AWT components, showing a
components tree and properties, automatic code generation and full
JavaBeans support.
• Version control Support: supports command lined vcs, supplying merging
and diff tools and containing a built- in CVS client.
• XML: XML, DTD and CSS Text Editor and XML Productivity Tools Wizards to
help user generate codes.
NetBeans Extras
• NetBeans Profiler: provides information about the runtime behavior of
applications. Allows developers to monitor the thread state, CPU
performance, and memory usage of their applications. makes it easy to
track down performance problems and memory leaks.
• NetBeans Platform: provides the services common to almost all large
desktop applications such as: window, menu, settings management and
storage, file access and more.
• NetBeans Mobility Pack: used to write, test, and debug applications for the
Java Micro Edition platform (J2ME) technology-enabled mobile devices. It
integrates support for the Mobile Information Device Profile (MIDP) 2.0,
the Connected, Limited Device Configuration (CLDC) 1.1.
• The mobility pack allows for the unique “On-Phone” debugging mode.
NetBeans Matisse
• The Goal: to take the best features from OSX and VS designers and allow
the same possibilities for Java Programmers.
• In order to reach that goal there was a need to develop a new layout
manager to support all the needed functionalities.
• Matisse provides a simple and intuitive layout of GUIs without having to
understand the complexities of Swing layout managers.
• As you drag and drop components into a form, the IDE automatically
suggests alignment, spacing, and resizing constraints.
• By simply right clicking a UI Object you can add an event handler with a
method waiting to be implemented without knowing too much about the
surrounding of this object. (watch example clip in the site)
Installation
• Installing JDK: in order to install NetBeans you need to first install JDK. You
can easily find an installation in Sun’s web site.
• NetBeans installation: you can find the installations kits for all the versions
in the NetBeans home page.
• Installation steps: you can watch a movie describing the installation step by
step in the.
Starting Up A Project
• When creating a new project, NetBeans already includes all the needed
packages for compiling and testing. It also outlines the sources by the right
logical directories and creates the files that are mandatory. For instance, if
you create a new java application you must implement a main class and so
it’s automatically created.
Testing
• JUnit Tests: you simply choose the class you want to test and in the tools
menu choose “create JUnit Test”. After filling the arguments NetBeans
automatically creates a test class inheriting from TestCase with the default
methods to implement and puts everything under the Test package.
Debugging
• NetBeans has two modes, run mode and debug mode.
• The debug mode is very easy to use.
• You can use the local variables window and watch window to follow the
progress of the program.