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

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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

Create a free website or blog at WordPress.com.

Up ↑

%d bloggers like this: