Java Programming Tutorials

Java Programming Tutorials And Articles
  Title Reverse Sort Order / Author Replies
Views
Introduction The instances of the String class represent a string that cannot be modified. If we do want to create modifiable strings because we are going to do lots of string manipulation, we should use the java.lang.StringBuffer and java.lang.StringBuilder classes.If we choose to do a lot of...
2
7,123
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...
4
42,640
1. How can you store a copy of an object at the same time other threads may be changing the object's properties? Choice 1 Override writeObject() in ObjectOutputStream to make it synchronized. Choice 2 Clone the object in a block synchronized on the object and serialize the clone. Choice 3...
23
145,877
Here is a simple implementation of client-server using Java. There are two java files, one for client code and one for server code. The code is quite self-explanatory. FactorialClient.java /* ** A TCP based client that will send the number entered by the user for factorial ** ...
3
18,670
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...
2
65,464
Introduction As we already know the primitive data type char represents a character. A chain of characters is called a string. The capability to handle strings is an important feature of any programming language. In Java, each character in a string is a 16-bit Unicode character.Because Unicode...
2
5,237
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...
1
62,011
In the previous two articles I discussed all essential features and methods of applet. Here I give some examples which would clear your concept about applets. A Font List Example This is an example of an applet that displays the standard fonts and styles. import java.applet.*; import...
1
9,389
When many items of data of the same class or type have to be stored, it is more efficient to use an array than separate variables or objects. For example, if the temperature on each day of the (non-leap) year had to be stored, rather than set up tempjan1, tempjan2... tempdec31 (365 variables)...
2
14,279
Introduction Assertion facility is added in J2SE 1.4. In order to support this facility J2SE 1.4 added the keyword assert to the language, and AssertionError class. An assertion checks a boolean-typed expression that must be true during program runtime execution. The assertion facility can be...
4
18,190
Some Examples are same from Java AWT Reference and is because when I did those in my college days referred many sources. Introduction Graphics in any language gives a wonderful look and feel to the users as well as programmers. Programmers draw figures, strings etc with the help of...
1
9,243
In the previous article Basic Graphics In Java With Examples I explained the methods of graphics class available for drawing various types of figures. In this article I will carry forward the graphics class with the methods it provides to work with those figures, methods available for working with...
1
6,571
Servlets are server side components that provide a powerful mechanism for developing server side programs. Servlets provide component-based, platform-independent methods for building Web-based applications, without the performance limitations of CGI programs. Using servlets web developers can...
1
7,537
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...
4
26,653
Compiler Problems 1. 'javac' is not recognized as an internal or external command, operable program or batch file If you receive this error, it means that Windows is not able to find the compiler (javac). Here's one way to tell Windows where to find javac. Set the PATH as follows on...
2
12,987
Introduction Have you ever searched for files and folders in Windows operating system? Generally most of the users try to search various .doc files, .pdf files etc. We generally search by giving *.doc or *.pdf in the text box of the search window of the windows OS. Of course windows OS provides...
5
16,521
In Java, networking is performed using Transmission Control Protocol/Internet Protocol (TCP/IP) or the User Datagram Protocol (UDP). Java provides a low-level control on the connection, allowing you to customize it according to your requirements. The package containing networking classes, called...
3
23,575
In this article I will discuss about window and some advanced components which can be added to our window such as Menu Bars and Menus. Window Fundamentals The AWT defines windows according to a class hierarchy that adds functionality and specificity with each level. The two most common...
2
5,535
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...
3
26,678
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...
0
26,080