 |
Multi-dimensional arrays
Java, as with most languages, supports multi-dimensional arrays - 1-dimensional, 2-dimensional, 3-dimensional, ... This discusses 2-dimensional arrays, but the same principles apply to higher dimensions.
2-dimensional arrays
2-dimensional arrays are usually...
By pradeep
Last Message By Healthcare
|
37 541,181 |
 |
Objects in Java are referred using reference types, and there is no direct way to copy the contents of an object into a new object.
The assignment of one reference to another merely creates another reference to the same object. Therefore, a special clone() method exists for all reference...
By pradeep
Last Message By javaexp
|
8 216,834 |
 |
We can create a thread in Java by extending Thread Class. A better way to create a thread in Java is to implement Runnable interface. A thread can be created by extending Java Thread class also. Now the question arises why implementing Runnable interface is a better approach? Answer is, if the...
By Sanskruti
Last Message By prabhas4
|
4 144,245 |
 |
Java is an object-oriented language and as said everything in java is an object. But what about the primitives? They are sort of left out in the world of objects, that is, they cannot participate in the object activities, such as being returned from a method as an object, and being added to a...
By techgeek.in
Last Message By Balaji Reddy
|
13 102,732 |
 |
This article demonstrates how to write a simple Stateful Session Bean. It consists of three POJO's: Remote interface Cart.java, Bean class CartBean.java and EJB client CartClient.java.
Prerequisites
In order to complete the example application, you should be familiar with the following:
*...
By Sanskruti
Last Message By Sujata420
|
7 70,821 |
 |
An Applet is a small program that can be sent across the Internet and interpreted on a client machine. To give permission for remote access it must be a public class. Typically it is a class that inherits and/or defines a special set of functions needed to run an applet. These are part of the class...
By pradeep
Last Message By pradeep
|
2 63,269 |
 |
Java's networking classes enable you to implement applications that communicate across a network/remote connection, but the platform also extends into the realm of the Internet and URLs. Java's URL class makes accessing Web resources as easy as accessing a local file. Let's take a look at how you...
By pradeep
Last Message By fiverivers
|
13 58,376 |
 |
LDAP - The Lightweight Directory Access Protocol
This directory access protocol which can either act as a gateway to other service or provide service itself. LDAP follows standardized way of managing directory information solutions of X.500.
The Lightweight Directory Access Protocol, better...
By thiruganeshkumar@gma
Last Message By pradeep
|
1 56,617 |
 |
This is a basic digital clock in Java that works off your operating system time, it works in a multithreaded environment and have coded it to put my own background in.
import java.awt.*;
import javax.swing.*;
import java.util.*;
class Clock extends JFrame implements Runnable
{
...
By Systemerror
Last Message By rkudoz
|
6 54,712 |
 |
Automatic Conversion
In Java type conversions are performed automatically when the type of the expression on the right hand side of an assignment operation can be safely promoted to the type of the variable on the left hand side of the assignment. Thus we can safely assign:
byte -> short -> int...
By pradeep
|
0 49,226 |
 |
Introduction
The 'main()' method in Java is referred to the thread that is running, whenever a Java program runs. It calls the main thread because it is the first thread that starts running when a program begins. Other threads can be spawned from this main thread. The main thread must be the...
By Sanskruti
Last Message By swaran
|
4 37,518 |
 |
The JavaMail API (http://java.sun.com/products/javamail/) is a messaging framework intended to build platform-independent applications that use e-mail messaging. It is included in the J2EE platform and is available as an optional package in J2SE. The API's main purpose is not for transporting,...
By Mary
|
0 29,382 |
 |
An initialization block is a block of code between braces that is executed before the object of the class is created. As the execution of the initialization block is dependent on the creation of the object we can easily make a guess that it has two types of object.
1. Non static initialization...
By shabbir
Last Message By Balaji Reddy
|
1 28,528 |
 |
Using Regular Expressions in Java
JDK versions 1.4.0 and later have comprehensive support for regular expressions through the standard java.util.regex package. Because Java lacked a regex package for so long, there are also many 3rd party regex packages available for Java. I will only discuss...
By pradeep
Last Message By elec.shabnam
|
13 26,265 |
 |
I often hear people asking on how to put an image on Java applications, thus here is an example of a painted panel that has an image in the same directory as the application *note* you cant use windows bmp with Java, but once you start creating your own images it's a good time to note that their...
By Systemerror
Last Message By tiwvinay
|
14 25,524 |
 |
Every class has at least one it's own constructor. Constructor creates a instance for the class. Constructor initiates something related to the class's methods. Constructor is the method which name is same to the class. But there are many difference between the method s and the Constructor.In this...
By Sanskruti
Last Message By Healthcare
|
3 24,950 |
 |
Before you can catch an exception, some code somewhere must throw one. Any code can throw an exception: your code, code from a package written by someone else such as the packages that come with the Java platform, or the Java runtime environment. Regardless of what throws the exception, it's always...
By Sanskruti
|
0 24,895 |
 |
A thread can be created in Java programs in two ways – by extending Thread class and by implementing Runnable interface. In case, where the class extends a Tread class, it must override run() method of the Thread class. The program may override the other methods also. If the program uses Runnable...
By Sanskruti
|
0 23,033 |
 |
Introduction
The code bound by the try block need not always throw a single exception. If in a try block multiple and varied exceptions are thrown, then you can place multiple catch blocks for the same try block in order to handle all those exceptions. When an exception is thrown it traverses...
By Sanskruti
|
0 21,555 |
 |
Introduction
Buffers can be very useful in Java since they speed up I/O operations considerably. Basically a buffer is a space allocated in memory for Bytes, Chars, and other data types to be stored. Buffers are really useful while writing Client/ Server applications.
Creating a Buffer
A...
By decodec
Last Message By pradeep
|
4 21,401 |