Smart Java Method.

Smart Java Method.

This post explains how to use toString and equal method ,so if you aleady know it ,breakOut and if not continue;

Java programmers write different methods which varies based on their specific target , toString and equals method are the two methods mostly used in java classes

What is toString method ?

A method that is meant for proper determination of object states , which return the state in string form , which are called whenever a reference to an object is passed as arguments to print(ln,f) methods.

1. Using toString methods

Example 1


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at

Up ↑

%d bloggers like this: