Java stack

Stack is a LIFO ADT (Last in first out abstract data type) and a linear data structure. In a jar the items on top (i.e. items that went in last) come our first. In a LIFO ADT, items that go in last come our first.

Stacks are a very useful data structure. Although you have the possibility of creating your own stack data structure from Java code, it is a better idea to simply use the stack provided by Java.

Code Following code shows how to use Java's stack:

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


Quick Summary of Java Technologies

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


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.