Powered by Blogger.

Importance of toString() in java

>> Saturday, October 20, 2012

Object to String using toString method_JavabynataraJ
Object class of Java is having predefined toString() method. This method by default Object class calls implicitly when an object created. Overriding toString manually is nothing but implementing this method in our class.The java toString() method is used when we need a string representation of an object. It is defined in Object class.

The toString() method is useful for debugging. By default, when an object is printed out in a print stream like System.out, the toString() method of the object is automatically called.
While develping the code the developers used to check the object properties are getting through the object or not. For this print statement will be useful to quick test in the console.

public String toString()
Returns: a string representation of the object.
Let us take a Person class and try to print the person object using the System.out.println() statement.

Tomcat The Definitive Guide 2007 eBook Download

>> Sunday, October 7, 2012

Tomcat The Definitive Guide 2007 JavabynataraJ
Tomcat: The Definitive Information is a important reference for administrators and site owners, a useful manual for programmers who want to use Tomcat as their world wide web software server during development or in production, and an outstanding introduction for anybody interested in Tomcat. Updated for the latest version of Tomcat, this new version provides a comprehensive manual to installing, configuring, maintaining and securing this servlet container. In fact, with these a prosperity of new information, this is essentially a new book quite than a straightforward revision.

You will come across information for making use of Tomcat on all significant platforms, including Windows, Linux, OS X, Solaris, and FreeBSD, together with specifics on Tomcat configuration files, and stage-by-action suggestions for deploying and jogging web applications.
This e-book offers complete information for:

How to sort an ArrayList

>> Tuesday, October 2, 2012

Sorting any ArrayList is pretty simple. Using Collections.sort( ) method we can sort the ArrayList. Collections class having all the static methods, we can use those methods directly along with the class name. These methods return the object as type Collection.

The important methods to synchronize the List, Set and Map as

synchronizedList(List<T> list)
synchronizedSet(Set<T> s)
synchronizedMap(Map<K,V> m) 

A simple program to sort an ArrayList

Related Posts Plugin for WordPress, Blogger...
© javabynataraj.blogspot.com from 2009 - 2014. All rights reserved.