Interview Questions on Java
1. What is the difference between private, protected, and public?
These keywords are for allowing privileges to components such as java methods and variables.
Pu..more
Extensible Markup Language (XML)
Extensible Markup Language (XML)
Extensible Markup Language (XML) is a W3C-recommended general-purpose markup language that supports a wide variety of app..more
How to Install Java
How to Install Java
These instructions are to help you download and install Java on your personal computer. You must install Java before instal..more
Java Constructors
Constructors
It can be tedious to initialize all of the variables in a class each time an instance is created.
Even when you add co..more
Servlet Basics and Handling the Client Request: Form Data
Servlet Basics
Topics in Chapter:
* The basic structure of servlets
* A simple servlet that generates plain text
* A servlet that generates HTML
* Servlets and packages
* Some utilities th
Java - Number Utility
public class First {
/**
* Method takes Object as parameter and returns decimal number.
* if argument is float or double and contains tailing zeros
 ..more
Java - Date Utility
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
public class First {
 ..more
Java - Message Window
import java.awt.*;
import jpb.*;
public class MessageWindow {
public static void main(String[] args) {
// Prompt user to enter font name
SimpleIO...more
Java - Basic Shapes (circle,rectangle) drawing
/* Displays a frame containing a random mixture of circles
and rectangles with random colors, sizes, and positions.
The shapes periodically change position, with the
direction of motion chosen randomly for each..more
Java - Phone Directory Program
// Stores names and telephone numbers and allows phone
// numbers to be looked up. The user is given a menu of
// three commands:
//
// a - Add a new phone number
// f - Find a phone number..more
Java - Number of Days in a Month
// Determines the number of days in a month
import jpb.*;
public class MonthLength {
public static void main(String[] args) {
// Prompt the user to enter a month
 ..more
Java - PickColor
// Allows the user to pick a color by moving three scrollbars
// (applet version)
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
public class PickColor2 extends Applet {
private Label redLabel =
new Label("Red = 1..more
Java - Random Circles drawing
// Draws randomly generated circles within a frame. The user
// will enter the size of the frame, the number of circles to
// be drawn, and the "delay time," which controls the drawing
// speed. If the user enters a non-integer value, the program
..more
Rename files in Java
import java.io.*;
import jpb.*;
public class RenameFiles {
public static void main(String[] args) {
// Obtain a list of all files in the current directory
File currentDirectory = new File(".");
String[] fileNames = currentDirect..more
Java - Garbage Collection Program
public class GarbageCollection {
/**
* Sole entry point to the class and application.
* @param args Array of String arguments.
*/
public static void main(String[] args) {
int SIZE = 4000;
StringBuff..more
Black Jack Game in Java
// Plays the game of Blackjack. At the beginning of each hand,
// the dealer (the program) and the player (the user) are
// each dealt two cards. If the player's cards total to 21,
// the hand is over and the player wins (unless the dealer
// a..more
Threads in Java
public class Threads extends Thread {
private String word; // What word to print
private int delay; // how long to pause
public PingPONG(String whatToSay, int delayTime) {
word = whatToSay;
delay = delayTi..more
Sounds Handling using Java applets
import java.awt.*;
import java.applet.Applet;
import java.awt.event.*;
import java.net.URL;
class ButtonHandler implements ActionListener
{
URL codeBase;
String clipName;
Applet ownerApplet;
public ButtonHandler (Applet _ownerApplet,
U..more
Java Advanced Servlet and JSP
The PDF versions of the tutorials are freely
available to anyone for personal use. These
versions contain the complete text of the
PowerPoint slides, and are what you want if your
goal is to learn..
Installing, Configuring, & Running Tomcat
Installing, Configuring, & Running Tomcat 6.0
Servlet Container on Microsoft Windows, and
Developing & Running your first JSP Page..
java tutorials Program to get Withdrawl amoun
Program to get Withdrawl amount and then the
denominations. please find the * import java.io.*;
import java.util.*;
public class forKajiri{
double wamount = 0.0;..
Java - INTRODUCTION TO JSP TAGS
In this lesson we will learn about the various
tags available in JSP with suitable examples. In
JSP tags can be devided into 4 different types.
These are:..
Java - Download The Java Tutorial
Download the online tutorial: When you download
the online tutorial, you get everything that's in
the java.sun.com version of the tutorial —
examples, HTML pages, images — the whole shebang...
Java - openlaszlo., the premier open-source p
OpenLaszlo is an open source platform
for creating zero-install web
applications with the user interface
capabilities of desktop client software.
OpenLaszlo programs are written in XML
and ..
Java - Introduction to Databinding
As far as importing data into an LZX
app is concerned, we always work in
XML. The XML declaration is not
required, but a single root XML node
is. Data is represented by the
element..
An abstract class can have instance methods that
implement a default behavior. An Interface can
only declare constants and instance methods, but
cannot implement default behavior and all methods
are implicitly abstract. An int..
Why threads block or enters to waiting state on I/O?
Threads enters to waiting state or block on I/O
because other threads can execute while the I/O
operations are performed.
..