<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4691235056759680907</id><updated>2024-11-08T21:35:56.539+06:00</updated><category term="Math"/><category term="Arrays"/><category term="String"/><category term="Integer"/><title type='text'>Learn Java API</title><subtitle type='html'>Comprehensive core Java API tutorials with relevant, easy and working examples for every Java Programmers</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://learnjavaapi.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4691235056759680907/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://learnjavaapi.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/00939922632952926437</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>8</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4691235056759680907.post-4164761675711303933</id><published>2014-07-31T13:37:00.000+06:00</published><updated>2014-07-31T13:37:39.330+06:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="String"/><title type='text'>String: startsWith() - Tests if this string starts with the specified prefix</title><summary type="text">If you want to get whether a string starts with a specified string, you can use the java.lang.String class&#39;s two overloaded startsWith() method. It returns true if the string contains the prefix or false otherwise.

In single argument startsWith() method, the only argument is the string that is the prefix in the specified string.

In two argument startsWith() method, the first argument is the </summary><link rel='replies' type='application/atom+xml' href='http://learnjavaapi.blogspot.com/feeds/4164761675711303933/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://learnjavaapi.blogspot.com/2014/07/String-startsWith-API-example.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4691235056759680907/posts/default/4164761675711303933'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4691235056759680907/posts/default/4164761675711303933'/><link rel='alternate' type='text/html' href='http://learnjavaapi.blogspot.com/2014/07/String-startsWith-API-example.html' title='String: startsWith() - Tests if this string starts with the specified prefix'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/00939922632952926437</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4691235056759680907.post-1549560399443822759</id><published>2014-07-30T12:23:00.000+06:00</published><updated>2014-07-31T13:38:16.495+06:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Math"/><title type='text'>Math: min() - Returns the smaller of two numbers</title><summary type="text">In order to return the smaller of two numbers, java.lang.Math class provides four static overloaded min() methods. The min() method takes two numbers as arguments and return the greater of the two.

The four overloaded min() methods are for int, long, float and double.

Some points about the min() method is given below:


If the two arguments are same, the method returns the same value.
The </summary><link rel='replies' type='application/atom+xml' href='http://learnjavaapi.blogspot.com/feeds/1549560399443822759/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://learnjavaapi.blogspot.com/2014/07/Math-min-API-example.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4691235056759680907/posts/default/1549560399443822759'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4691235056759680907/posts/default/1549560399443822759'/><link rel='alternate' type='text/html' href='http://learnjavaapi.blogspot.com/2014/07/Math-min-API-example.html' title='Math: min() - Returns the smaller of two numbers'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/00939922632952926437</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4691235056759680907.post-2278805469025084009</id><published>2014-07-30T00:07:00.000+06:00</published><updated>2014-07-31T13:39:08.488+06:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Math"/><title type='text'>Math: max() - Returns the greater of two numbers</title><summary type="text">In order to return the greater of two numbers, java.lang.Math class provides four static overloaded max() methods. The max() method takes two numbers as arguments and return the greater of the two.

The four overloaded max() methods are for int, long, float and double.

Some points about the max() method is given below:

If the two arguments are same, the method returns the same value.
The method</summary><link rel='replies' type='application/atom+xml' href='http://learnjavaapi.blogspot.com/feeds/2278805469025084009/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://learnjavaapi.blogspot.com/2014/07/Math-max-API-example.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4691235056759680907/posts/default/2278805469025084009'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4691235056759680907/posts/default/2278805469025084009'/><link rel='alternate' type='text/html' href='http://learnjavaapi.blogspot.com/2014/07/Math-max-API-example.html' title='Math: max() - Returns the greater of two numbers'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/00939922632952926437</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4691235056759680907.post-4511204741085195504</id><published>2014-07-27T11:16:00.002+06:00</published><updated>2014-07-31T13:40:52.158+06:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Arrays"/><title type='text'>Arrays: sort() – Sorts an array</title><summary type="text">In order to sort an array, java.util.Arrays class provides 18 overloaded sort() method for not only primitive types(excluding boolean) and Object, but also your custom sort implementation for your own objects.

For single argument (primitive types) sort() method, it sorts the specified array in ascending numerical order.

For three argument (primitive types) sort() method, the first argument is </summary><link rel='replies' type='application/atom+xml' href='http://learnjavaapi.blogspot.com/feeds/4511204741085195504/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://learnjavaapi.blogspot.com/2014/07/Arrays-sort-API-example.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4691235056759680907/posts/default/4511204741085195504'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4691235056759680907/posts/default/4511204741085195504'/><link rel='alternate' type='text/html' href='http://learnjavaapi.blogspot.com/2014/07/Arrays-sort-API-example.html' title='Arrays: sort() – Sorts an array'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/00939922632952926437</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4691235056759680907.post-7595341123049244120</id><published>2014-07-26T10:53:00.001+06:00</published><updated>2014-07-31T13:40:35.837+06:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Arrays"/><title type='text'>Arrays: toString() – Returns string representation of an array</title><summary type="text">
Normally if
you want to get &amp;nbsp;the string
representation of the contents of an array, you need to traverse the array
using loop constructs. But java.util.Arrays class provides nine overloaded
toString() methods to return the string representation of the contents of the
specified array which is passed as the only argument to the method.



The string
representation consists of a list of the </summary><link rel='replies' type='application/atom+xml' href='http://learnjavaapi.blogspot.com/feeds/7595341123049244120/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://learnjavaapi.blogspot.com/2014/07/Arrays-toString-API-example.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4691235056759680907/posts/default/7595341123049244120'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4691235056759680907/posts/default/7595341123049244120'/><link rel='alternate' type='text/html' href='http://learnjavaapi.blogspot.com/2014/07/Arrays-toString-API-example.html' title='Arrays: toString() – Returns string representation of an array'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/00939922632952926437</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4691235056759680907.post-6922679754669678310</id><published>2014-07-25T18:55:00.000+06:00</published><updated>2014-07-31T13:40:14.378+06:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="String"/><title type='text'>String: contains() - Checks whether a CharSequence is present in a String</title><summary type="text">
If you want to
check whether a string contains a specified character sequence that implements
CharSequence interface (String, StringBuffer, StringBuilder), you can use
contains() method defined in java.lang.String class. This method takes a
character sequence as single argument and return true if the specified argument
is present in the string or false if it doesn’t.



Some critical
points to </summary><link rel='replies' type='application/atom+xml' href='http://learnjavaapi.blogspot.com/feeds/6922679754669678310/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://learnjavaapi.blogspot.com/2014/07/String-contains-API-example.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4691235056759680907/posts/default/6922679754669678310'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4691235056759680907/posts/default/6922679754669678310'/><link rel='alternate' type='text/html' href='http://learnjavaapi.blogspot.com/2014/07/String-contains-API-example.html' title='String: contains() - Checks whether a CharSequence is present in a String'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/00939922632952926437</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4691235056759680907.post-8513487024207527884</id><published>2014-07-25T17:06:00.000+06:00</published><updated>2014-07-31T13:39:57.978+06:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Math"/><title type='text'>Math: abs() - Returns the absolute value of a number</title><summary type="text">
To get the
absolute value of a number, java.lang.Math class defines four static overloaded
abs() methods that takes an int or long or float or double as its only argument
and returns the absolute value of that passed argument.



The following
rules apply for this methods:


If the passed
argument is positive, then this method returns the argument.
If the passed
argument is negative, this method</summary><link rel='replies' type='application/atom+xml' href='http://learnjavaapi.blogspot.com/feeds/8513487024207527884/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://learnjavaapi.blogspot.com/2014/07/Math-abs-API-example.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4691235056759680907/posts/default/8513487024207527884'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4691235056759680907/posts/default/8513487024207527884'/><link rel='alternate' type='text/html' href='http://learnjavaapi.blogspot.com/2014/07/Math-abs-API-example.html' title='Math: abs() - Returns the absolute value of a number'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/00939922632952926437</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4691235056759680907.post-3542462979443916384</id><published>2014-07-25T11:02:00.000+06:00</published><updated>2014-07-31T13:39:37.228+06:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Integer"/><title type='text'>Integer: bitCount() - Returns the number of one bits in an intger</title><summary type="text">
If you want to get the
number of set bits in an integer, you can use the static bitCount() method in
java.lang.Integer class by passing the desired integer as argument.



Consider an integer 5
which has binary representation 101. Here, the number of one bits (set bits) is
2. So, bitCount(5) returns 2.



For negative integer it
returns the number of one bits in two’s complement representation </summary><link rel='replies' type='application/atom+xml' href='http://learnjavaapi.blogspot.com/feeds/3542462979443916384/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://learnjavaapi.blogspot.com/2014/07/Integer-bitCount-API-example.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4691235056759680907/posts/default/3542462979443916384'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4691235056759680907/posts/default/3542462979443916384'/><link rel='alternate' type='text/html' href='http://learnjavaapi.blogspot.com/2014/07/Integer-bitCount-API-example.html' title='Integer: bitCount() - Returns the number of one bits in an intger'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/00939922632952926437</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>