Java Font Example

Java AWT supports graphics drawing in colors and fonts. To support colors and fonts, the Java.awt package come with two classes – class Color and class Font. Java Font Example to create font objects and changing change string fonts.

Output Screenshot on Java Font Example Font f1 = new Font(“Monospaced”,…

RMI Database Access Simple Application

RMI Database Access Application Before this program, it is advised to read the previous simple application InterestCalculation where the basic notes and guidelines are given. This application adds extra features to the previous application like database access, security features and handling exceptions thrown by each method instead of throwing a…

RMI Application Step by Step Explanation

RMI Application Coding Note: But before going into this tutorial, it is advised to read RMI tutorial and also architecture. A typical RMI application includes four programs. Remote interface: Write an interface that should extend an interface called Remote from java.rmi package. Implementation program: Write a concrete class which extends…

RMI Architecture Java

The RMI Architecture is very simple involving a client program, a server program, a stub and skeleton. In RMI, the client and server do not communicate directly; instead communicates through stub and skeleton (a special concept of RMI and this is how designers achieved distributed computing in Java). They are…

Multithreading Realtime Examples

Summary: By the end of this tutorial "Multithreading Realtime Examples", you will come to know the realtime applications of multithreading. Generally you will be eating dinner while watching TV. At the same time, you may be talking to your mother to get some more eatables. Now, you are doing three…

Removing Duplicates Array Java

Removing Duplicates Array Java Summary: Java is so developed by Designers to write code easily for Developers. Forget the laborious days of C/C++ coding. This tutorial "Removing Duplicates Array Java" is the place to prove it. It is a general and interesting code for beginners and this can be achieved…

Remove Duplicate Elements in ArrayList

It is a general and interesting code for beginners and this can be achieved in many ways in Java. This code, I would like to keep the code as simple as possible without using any methods and without using any laborious loops of C/C++. Here, I use only constructors but…

Difference Encapsulation Abstraction

Difference Encapsulation Abstraction Summary: It is very confusing concept, as one depends on other, for a Java beginner to understand. Explained in simple terms in this tutorial "Difference Encapsulation Abstraction". How to explain the difference between Encapsulation and Abstraction before an Interviewer? Encapsulation is an OOPS concept. As everyone says,…

StringBuffer Constructors Example

StringBuffer is mutable and String is immutable. To modify the string present in the buffer, many methods are defined in StringBuffer class. Apart methods, there are 4 types of StringBuffer Constructorsas on Java SE 7. public StringBuffer() public StringBuffer(int initialCapacity) public StringBuffer(String str) public StringBuffer(CharSequence seq) Let us see what…

reverse() StringBuffer Example

java.lang.StringBuffer class comes with many utility methods to manipulate string. One of the method is reverse() used to reverse the contents of the buffer. After this method call, original buffer itself gets effected. Note: reverse() is not a method of String; applying on string raises compilation error. What Java API…

lastIndexOf() StringBuffer Example

java.lang.StringBuffer class comes with many helper methods to manipulate string. One of the methods is overloaded lastsIndexOf() method used to search for the last occurrence of a stirng in the buffer. What Java API says abou lastIndexOf() StringBuffer: public int lastsIndexOf(String searchString): Returns an int value of the last occurrence…