Archive for the ‘Java‘ Category

Creating Simple Window in Java: using swings

This Java video tutorial demonstrates the creation of a simple window by importing Swings package and extending JFrame class. import javax.swing.*; javax.swing provides a set of lightweight components that, to the maximum degree possible, works the same on all platforms. myWindow Class class myWindow extends JFrame {   } myWindow is user the name given [...]

Read Keyboard Input: Java

This video tutorial shows how to read user input from Keyboard in Java. In this tutorial we illustrate using a relatively simple program, where user is asked to input some string and it is read by the program and then out put to the console window. Simple java program. Import We have to import io [...]

Try, Catch and Finally in Java

This Java Video Tutorial illustrates the use of try, catch and finally along with the Exceptions like: ArrayIndexOutOfBoundsException, ArithmeticException. Exceptions: Checked Exceptions: Environmental error that cannot necessarily be detected by testing; e.g. disk full, broken socket, database unavailable, etc. Errors: Virtual machine error: class not found, out of memory, no such method, illegal access to [...]

Display System Date and Time: Java

This Java Video Tutorial shows how to extract and display system date(with time stamp). Inorder to make this program work, you MUST include or import Date class of util package. import java.util.Date; Video Tutorial: Extract and display System Date and Time: Java YouTube Link: http://www.youtube.com/watch?v=XwQfh8i81r4 [Watch the Video In Full Screen.] We create an object [...]

Addition/Subtraction of Complex Number: Java

Method/Function Overloading in Java

In Java, function overloading is called Method Overloading. Definition: In java method overloading means creating more than one method with same name but with different signature. i.e., If name of the method remains common but the number and type of parameters are different, then it is called method overloading in Java. Overloaded Methods: Here, these [...]

Using Constructors & Member Function to add two numbers: Java

In this Java video tutorial we have covered both ways of adding numbers: using constructors as well as using methods. Constructors: Constructor name and the class name must be same. No return type. There are 3 types of constructors: 1. Default constructors. 2. Parameterized constructors. 3. Copy Constructors. In this video tutorials we have shown [...]

First Java Program: Basic

This Java tutorial will illustrate the basics of all java programs. class Welcome Class is a keyword. Welcome is an identifier or name of the class. Class Welcome is declaration of class. class Welcome {   } Every class definition in Java begins with an opening brace and ends with a matching closing brace. Note [...]