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.

Read more..

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

Read more..

Starting Struts2 by Ian Roughley eBook Download

>> Sunday, September 30, 2012

Struts2 is the latest manifestation of the popular Struts Java web application framework. Like its predecessor, its goals are to make web application development faster, easier and more productive than ever before. Despite new languages and new techniques, the action-base MVC framework is still a viable and effective option for modern web application development.

Within this book you will find everything you need to get up and running using Struts2 - from the architecture and configuration, to implementing actions and the supporting infrastructure such as validation and internationalization.

The concepts covered by this book:
  • WHERE STRUTS2 FITS INTO THE WEB PARADIGM
  • CORE COMPONENTS
  • ARCHITECTURAL GOALS
  • PRODUCTIVITY TIPS
  • INTEGRATING WITH OTHER TECHNOLOGIES

Read more..

Configure Tomcat in MyEclipse 9.1

>> Sunday, September 16, 2012

Once the Tomcat 6.0 installation is done in your local system, configure it in MyEclipse IDE.
Follow the below steps to configure Tomcat 6.0 in your MyEclipse.
Step1: Go to MyEclipse menu bar and select Window menu from there select preferences.

Read more..

Installing and Configuring Tomcat 6.0

>> Sunday, September 9, 2012

Apache Tomcat is an open source software implementation of the Java, Servlet and JavaServer Pages technologies.We can use this to run our Java,Jsp and Servlet based web applications.We can deploy and monitor our application in this.

Double click on apache-tomcat-6.0.14.exe file.A prompt shows in windows 7 to accept installation.Before installing the tomcat you close all other applications.This will make it possible to update relevant system files without having to reboot your computer.

 Step 1: A Welcome Setup wizard displays after double clicking setup file. Click on Next button.

Read more..

How to configure Java in MyEclipse 9.1

>> Wednesday, August 29, 2012

Configure java1.5 on MyEclipse_JavabynataraJ
To run java using MyEclipse 9.1 we should configure this. MyEclipse having more features to develop projects and this will be very useful for developers. This is the next generation of the MyEclipse Enterprise Workbench IDE for enterprise Java and web developers. Basically it supports Java EE 6.0 features such as:
  • Servlet 3.0
  • JSF 2.0
  • JPA 2.0
  • EJB 3.1
  • JAX-RS 1.1
MyEclipse having some Struts 2 Enhancements
  • Improved connection routing
  • Better undo/redo suport
  • Struts 2 specific validation for Struts 2 configuration files
Install MyEclipse in you System.

Read more..

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