Archive for the ‘Programming’ Category

My SCJP Victory

Wednesday, February 4, 2009 11:25 No Comments

These are my SCJP certification kit Sun. I was very happy and exited to receive on of my biggest wish to come true about ever wanted Sun certification. You can see my SCJP certificates + nice visting type card that I can put in my pocket voilet. Now, with the great success and passion with [...]

This was posted under category: Articles, Java Tags: ,

Java Generating Prime Number

Thursday, August 7, 2008 0:07 No Comments

/*
This class check the prime number between 1 to 1000 and write the prime number.
*/
public class PrimeNumber
{
// This method tests whether a given number is prime or not.
public static boolean isPrime ( int num )
{
boolean prime = true;
int limit = (int) Math.sqrt ( num );
for ( int i = 2; i <= limit; i++ )
{
if [...]

This was posted under category: Java Tags: , , , , ,

Java JDBC with using Oracle

Monday, August 4, 2008 12:28 1 Comment

The JDBC is used whenever a Java application should communicate with a relational database for which a JDBC driver exists. JDBC is part of the Java platform standard; all visible classes and interfaces used in the JDBC are placed in package Java
Main JDBC classes:
Download the Java connecting with Oracle Code, you have to [...]

This was posted under category: Java Tags: , ,

Java creating custom Exceptions

Monday, August 4, 2008 12:16 1 Comment

Java supports the custom, user defined exception. Java provides the well known and common exception classes and gives freedom for developer to create their own exception classes matching to their specific business logic/role. For example, a user not found exception would be implemented by its own.
Download the Java Source code  for creating user custom exceptions
MyException.java  [...]

This was posted under category: Java Tags: , ,

Java Object Serialization by using Java I/O Streams

Monday, August 4, 2008 12:12 No Comments

The task is to store different objects of classes in a physically located file on hard disk. For this to store objects and their states (including the values of their data members) we have to make those classes serializeable. Use Standard Java I/O streams FileOutputStream, ObjectOutputStream to write/store to file and FileInputStream, ObjectInputStream streams to [...]

This was posted under category: Java Tags: , ,

Understanding Exceptions in Java

Monday, June 30, 2008 12:23 No Comments

An exception is an error that happens when an application is running. When an exception condition happens, the exception is said to be thrown, and it changes the normal execution control flow of the program. Java offers a very comprehensive and flexible system for exception handling. The main benefit of such a system is that [...]

This was posted under category: Java Tags: , , , ,

Composition and Aggregation using Java

Sunday, June 29, 2008 1:22 8 Comments

There is always been confusion about composition and aggregation. While in servicing NetSol Technologies, I came to learn practically what is composition and aggregation. First thing is both are type of association.  Below is the exact definition of each term and then practical Java code, where you can understand exactly how can we implement composition [...]

This was posted under category: Java Tags: , , , ,

How to Take Screenshots in Java

Wednesday, April 30, 2008 23:44 No Comments

Have you ever wanted to grab a screenshot from your Java application? Here’s a quick tutorial on how to grab a screenshot and save it to a JPEG and PNG file. This shows how to use the Robot class to capture the screen image and the ImageIO API to save it as a JPG and [...]

This was posted under category: Java Tags: , , ,

Java Buzzwords

Sunday, April 20, 2008 10:02 1 Comment

You will hear and see quite a few Java buzzwords in the Java world. It’s important to know the Java buzzwords because they represent the factors that have played important roles in shaping the Java language. These words are summarized in Table 1-3.

Buzzword

Description

Architecture neutral
The Java compiler compiles the source code into bytecode, [...]

This was posted under category: Java Tags: , , , , ,

The Memory Usage by a Java Program

Sunday, April 20, 2008 9:56 No Comments

The instructions of a running program and the related data are temporarily stored in the computer memory. Java has good news for you here: you don’t need to worry about memory management because the JVM and garbage collector will take care of it. However, you can help by being aware of where different things are [...]

This was posted under category: Java Tags: , , , , ,