ITSourceCode.com

Free Source Code and Tutorials

Custom Search

Category: Java

Thread States / Thread Life Cycle in Java

In this post we will about Thread States in Java or in other terms Thread Life Cycle . Below are the various stages in a Thread Life : NEW : Before start() ┬ámethod RUNNABLE : After start() method BLOCKED : Whenever thread is going under deadlock WAITING: While calling wait() method and while calling join() […]

Share this

Throw Keyword in JAVA (User Defined Exception )

In this article we will discuss about “throw” keyword in Java. Usage of throw keyword is anti to exception handling that is we are raising exception and not handling it. Let us take an example to understand this better. < View plain text > java import java.util.Scanner;   public class Manager{   public static void […]

Share this

How to write to a file or a plain text document?

How to write to a file or a plain text document? There are multiple ways to write data into text file or plain text file. We will learn the most standard way of writing into a text file. Let us take an example: < View plain text > java public class Manager{ public static void […]

Share this

Serialization in Java

In this post we will learn about Serialization in Java. Serialization is a mechanism in Java wherein we write object state into file system. It is insecure operation as compare to Object cloning. Let us go little bit in depth to understand more. Through this mechanism object can be represented as a sequence of bytes […]

Share this

How to read a plain text file in Java?

In this post we will learn how to read data from a plain text file. There are multiple ways in Java about how to read data and write data from/in a text file. Also multiple third party party applications are present in the market which we can use while dealing with reading or writing operation. […]

Share this

Java ArrayList

In this post we will learn about Java Array List. Java ArrayList class uses a dynamic array for storing the elements i.e. we don’t need to specify size as in case of traditional Array we used to do. It extends AbstractList class and implements List interface. ArrayList class can contain duplicate elements. ArrayList class can […]

Share this

Finalize method in java

In this post we will learn about finalize() method. Few facts about finalize() method that we should be aware of are listed below: It is a method of object() class and we can override and overload this method. This method is called by garbage collector whenever object is removing from the memory by the garbage […]

Share this

Java Assertion

Assertion in Java was introduced in JDK 1.4. Assert is a keyword. There are two types of assert statements : very simple assert statement. assert <boolean_result>; (After assert there should be a space ) simple assert statement. assert< boolean_result> :some literal By default assert statements will not execute because they are disabled. In order to […]

Share this

Scanner Class in Java

Scanner is a concrete class in Java. Hence, we can create object of Scanner class using new operator. Scanner sc= new Scanner (System.in); It is developed inside java.util package and was introduced in JDK 1.5 . It is having one constructor which required input stream through System.in .   Let us take a simple example […]

Share this

Wrapper Classes in Java

For every primitive data, there are corresponding wrapper classes.┬áThere are total eight primitive data type and eight corresponding wrapper classes which are listed below: byte : Byte short: Short int : Integer long : Long float: Float double : Double char : Character boolean: Boolean All these Wrapper classes are available in java.lang package developed […]

Share this
Page 3 of 41234
ITSourceCode.com © 2016 Frontier Theme

Subscribe For Latest Updates

Signup for our newsletter and get notified when we publish new articles for free!