Java

Jar, War, and Ear files

.ear, .war, and .jar files are simply files zipped using Java jar tool. Each file is created for a different purpose:

.jar files

Jar (Java Archive) files contain libraries, resources and accessory files such as property files.

.war files

War (Web Archive) files contain web applications that can be deployed on any servlet/jsp container. It also contains other files required by the web application such as html, javascript, css, etc.

.ear files

Ear (Enterprise Archive) files contain EJB modules.

Java and Memory

From a programming point of view, there are essentially six different places to store data on your computer. The fastest storage is the registers since this memory resides inside the processor itself. No high-level language gives you direct access to this memory.

Java break and continue

Java’s break and continue statements are used to alter the flow of control.

break The break statement can be used in for, while or do-while loops. It is also used in switch structure. A break statement exits the loop without executing the rest of the code in the loop. In other words, if the program encounters a break inside a for loop, it exits the loop without executing the remaining statements even if the test condition of the loop is still valid.

Java file I/O

Java provides a number of classes and methods that allow to read and write files. In Java all files are byte-oriented. Two of the most often-used stream classes are FileInputStream and FileOutputStream, which create byte streams linked to files.

  1. To open a file, simple create an object of one of the classes specifying the name of the file as an argument to the constructor.
  2. Use close() to close the file

Syntax

Quick Summary of Java Technologies

The following is a very quick and brief summary of Java technologies with links to more information.

Java

Java is an object-oriented programming language.

Java SE

Java SE or standard edition provides API for desktop applications.

Java EE

Java EE or enterprise edition provides API provided in Java SE and also provides API for client server and remote messaging operations.

Java Servlets

Java servlets are server-side programs that handle client requests and return dynamic responses.