<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2enclosuresfull.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Learn Java by Examples</title><link>http://www.hubberspot.com/</link><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/LearnJavaByExamples" /><description>Java How to Program. Everything you want to know about Java. Tutorials, Source Codes, SCJP, SCWCD, Frameworks, Java EE and Design Patterns.</description><language>en</language><managingEditor>noreply@blogger.com (jontymagicman)</managingEditor><lastBuildDate>Mon, 20 May 2013 05:30:03 PDT</lastBuildDate><generator>Blogger http://www.blogger.com</generator><openSearch:totalResults xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/">410</openSearch:totalResults><openSearch:startIndex xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/">1</openSearch:startIndex><openSearch:itemsPerPage xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/">25</openSearch:itemsPerPage><feedburner:info uri="learnjavabyexamples" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><itunes:owner><itunes:email>noreply@blogger.com</itunes:email></itunes:owner><itunes:explicit>no</itunes:explicit><itunes:subtitle>Java How to Program. Everything you want to know about Java. Tutorials, Source Codes, SCJP, SCWCD, Frameworks, Java EE and Design Patterns.</itunes:subtitle><item><title>How to write to a file line by line using Apache Commons-io API in Java ?.</title><link>http://feedproxy.google.com/~r/LearnJavaByExamples/~3/qNWyxJAvRwo/how-to-write-to-file-line-by-line-using.html</link><category>Apache API in Java</category><category>Java Source Code</category><author>noreply@blogger.com (jontymagicman)</author><pubDate>Mon, 20 May 2013 05:30:03 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7221851061679184814.post-5977332677026570354</guid><description>
Program to demonstrate how to write to a file line by line using Apache Commons-io API in Java.  

package com.hubberspot.apache.commons.examples;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import org.apache.commons.io.FileUtils;

public class WriteContentsToFile {

    public static void main(String[] args) {

        Collection&amp;lt; </description><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-20T18:00:03.852+05:30</app:edited><media:thumbnail url="http://3.bp.blogspot.com/-FBicFaBbipY/UY1owKbEYbI/AAAAAAAAD54/zmbmZHG9fd8/s72-c/write+line+by+line+to+a+file+using+commons+io+package.jpg" height="72" width="72" /><feedburner:origLink>http://www.hubberspot.com/2013/05/how-to-write-to-file-line-by-line-using.html</feedburner:origLink></item><item><title>How to clean contents of a directory using Apache commons-io API in Java ? </title><link>http://feedproxy.google.com/~r/LearnJavaByExamples/~3/Ieem0TzY15A/how-to-clean-contents-of-directory.html</link><category>Apache API in Java</category><category>Java Source Code</category><author>noreply@blogger.com (jontymagicman)</author><pubDate>Sun, 19 May 2013 05:30:00 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7221851061679184814.post-6873415923729300418</guid><description>Program to demonstrate how to clean contents of a directory using Apache commons-io API in Java.  

package com.hubberspot.apache.commons.examples;

import java.io.File;
import java.io.IOException;

import org.apache.commons.io.FileUtils;

public class CleanDirectoryDemo {

    public static void main(String[] args) {

        // Create a File object and pass path of the directory
        // </description><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-19T18:00:00.589+05:30</app:edited><feedburner:origLink>http://www.hubberspot.com/2013/05/how-to-clean-contents-of-directory.html</feedburner:origLink></item><item><title>How to search for files in a directory based on extension using Apache commons-io API in Java ?</title><link>http://feedproxy.google.com/~r/LearnJavaByExamples/~3/iGLHOGe9S74/how-to-search-for-files-in-directory.html</link><category>Apache API in Java</category><category>Java Source Code</category><author>noreply@blogger.com (jontymagicman)</author><pubDate>Sat, 18 May 2013 05:30:01 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7221851061679184814.post-2135287621714758239</guid><description>
Program to demonstrate how to search for files in a directory based on extension using Apache commons-io API in Java.  

package com.hubberspot.apache.commons.examples;

import java.io.File;
import java.util.Collection;
import java.util.Iterator;
import org.apache.commons.io.FileUtils;

public class RecursiveFileSearch {

    public static void main(String[] args) {

        // Create a File </description><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-18T18:00:01.582+05:30</app:edited><media:thumbnail url="http://1.bp.blogspot.com/-2CUdq5EwRgc/UY05uAFfDSI/AAAAAAAAD5o/q_Gx1foaorQ/s72-c/recursive+search+of+the+files.jpg" height="72" width="72" /><feedburner:origLink>http://www.hubberspot.com/2013/05/how-to-search-for-files-in-directory.html</feedburner:origLink></item><item><title>How to read a file contents and convert it to String using Apache commons-io API in Java ?</title><link>http://feedproxy.google.com/~r/LearnJavaByExamples/~3/BISBwgefu4s/how-to-read-file-contents-and-convert.html</link><category>Apache API in Java</category><category>Java Source Code</category><author>noreply@blogger.com (jontymagicman)</author><pubDate>Fri, 17 May 2013 05:30:04 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7221851061679184814.post-3287288833540534234</guid><description>
Program to demonstrate how to read a file contents and convert it to String using Apache commons-io API in Java.  

package com.hubberspot.apache.commons.examples;

import java.io.File;
import java.io.IOException;
import java.util.List;

import org.apache.commons.io.FileUtils;

public class FileContentsToString {

    public static void main(String[] args) {

        // Create a File object and </description><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-17T18:00:04.738+05:30</app:edited><media:thumbnail url="http://2.bp.blogspot.com/-2nIOeA6SdUQ/UY0jJ-cAkYI/AAAAAAAAD5Y/WheXMnapNng/s72-c/read+file+line+by+line+using+commons+io+package.jpg" height="72" width="72" /><feedburner:origLink>http://www.hubberspot.com/2013/05/how-to-read-file-contents-and-convert.html</feedburner:origLink></item><item><title>How to read a file contents line by line using Apache commons-io API in Java ?</title><link>http://feedproxy.google.com/~r/LearnJavaByExamples/~3/FLJ4M1zcusA/how-to-read-file-contents-line-by-line.html</link><category>Apache API in Java</category><category>Java Source Code</category><author>noreply@blogger.com (jontymagicman)</author><pubDate>Thu, 16 May 2013 05:30:00 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7221851061679184814.post-316217606217483604</guid><description>
Program to demonstrate how to read a file contents line by line using commons-io API in Java.  

package com.hubberspot.apache.commons.examples;

import java.io.File;
import java.io.IOException;
import java.util.List;

import org.apache.commons.io.FileUtils;

public class ReadFileLineByLine {

    public static void main(String[] args) {
        
        // Create a File object and pass name of </description><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-16T18:00:00.918+05:30</app:edited><media:thumbnail url="http://3.bp.blogspot.com/-4BH4bAoLdDc/UY0PfqZvUEI/AAAAAAAAD5I/nIkgvP_G_Qk/s72-c/read+file+line+by+line+using+commons+io+package.jpg" height="72" width="72" /><feedburner:origLink>http://www.hubberspot.com/2013/05/how-to-read-file-contents-line-by-line.html</feedburner:origLink></item><item><title>How to create a simple JTree in Java using Java Swing API ?. </title><link>http://feedproxy.google.com/~r/LearnJavaByExamples/~3/4xA-Lh2JwVU/how-to-create-simple-jtree-in-java.html</link><category>AWT and Swing</category><author>noreply@blogger.com (jontymagicman)</author><pubDate>Wed, 15 May 2013 07:30:01 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7221851061679184814.post-9021612915070634075</guid><description>
Program to demonstrate how to create a simple JTree in Java using Java Swing API ?.  

package com.hubberspot.swing.examples;

import java.awt.*;
import javax.swing.*;
import javax.swing.tree.DefaultMutableTreeNode;

public class JTreeDemo
{
    public static void main(String[] args)
    {
        EventQueue.invokeLater(new Runnable()
        {
            public void run()
            {
</description><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-15T20:00:01.024+05:30</app:edited><media:thumbnail url="http://3.bp.blogspot.com/-ajF6_xS1RhY/UY0Fu-4ec8I/AAAAAAAAD44/Qtg1K5h1kXU/s72-c/JTree+Demo+in+swing+Java.jpg" height="72" width="72" /><feedburner:origLink>http://www.hubberspot.com/2013/05/how-to-create-simple-jtree-in-java.html</feedburner:origLink></item><item><title>Write a Java program to calculate sum of the digits of a number entered by the user. </title><link>http://feedproxy.google.com/~r/LearnJavaByExamples/~3/oM6NI2kRNiY/write-java-program-to-calculate-sum-of.html</link><category>ICSE Exam Questions</category><category>Java Source Code</category><author>noreply@blogger.com (jontymagicman)</author><pubDate>Mon, 13 May 2013 12:17:00 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7221851061679184814.post-8515468807831175767</guid><description>
Program to calculate sum of the digits of a number entered by the user in Java  

package com.hubberspot.java.example;

import java.util.Scanner;

public class SumOfDigitsDemo {

    public static void main(String[] args) {

        Integer number;

        Scanner scanner = new Scanner(System.in);

        System.out.print("Enter the number whose" +
                " sum of digits is to be </description><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-14T00:47:00.018+05:30</app:edited><media:thumbnail url="http://2.bp.blogspot.com/-eoUxVRvr3mM/UYFrV9hyOZI/AAAAAAAAD4g/LjpSF9el8-0/s72-c/sum+of+digits+entered+by+the+user+on+console.jpg" height="72" width="72" /><feedburner:origLink>http://www.hubberspot.com/2013/05/write-java-program-to-calculate-sum-of.html</feedburner:origLink></item><item><title>How to handle Mouse Click events in Java ?.</title><link>http://feedproxy.google.com/~r/LearnJavaByExamples/~3/wrIquHpwNIU/how-to-handle-mouse-click-events-in-java.html</link><category>AWT and Swing</category><category>Java Source Code</category><author>noreply@blogger.com (jontymagicman)</author><pubDate>Mon, 13 May 2013 04:30:07 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7221851061679184814.post-6866541071129800739</guid><description>
Program to demonstrate how to handle Mouse Click events in Java.  

package com.hubberspot.swing.examples;

import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import javax.swing.JFrame;
import javax.swing.JTextArea;
import javax.swing.SwingUtilities;

public class MouseClickEventHandling extends JFrame {

    public static void main(String[] args) {

        </description><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-13T17:00:07.101+05:30</app:edited><media:thumbnail url="http://2.bp.blogspot.com/-Y34Tsns-6JE/UYE24sLHOEI/AAAAAAAAD34/2K629V9wV8M/s72-c/Mouse+Event+Clicked.jpg" height="72" width="72" /><feedburner:origLink>http://www.hubberspot.com/2013/05/how-to-handle-mouse-click-events-in-java.html</feedburner:origLink></item><item><title>Pattern problems : Write a Java program to print same character on each line and having character printed in Square shape form.</title><link>http://feedproxy.google.com/~r/LearnJavaByExamples/~3/OYXAID6bacE/pattern-problems-write-java-program-to_12.html</link><category>ICSE Exam Questions</category><category>Java Source Code</category><author>noreply@blogger.com (jontymagicman)</author><pubDate>Sun, 12 May 2013 05:24:00 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7221851061679184814.post-1367892296605477940</guid><description>
Program to Pattern problems : Write a Java program to print same   character on each line and having character printed in Square Shape  form. As  shown below : 

*  *  *  *  *  * 
*               *
*               *
*               *
*  *  *  *  *  * 
   

package com.hubberspot.patterns.problems;

import java.util.Scanner;

public class SquarePattern {

    public static void main(String[] args</description><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-12T17:54:00.312+05:30</app:edited><media:thumbnail url="http://3.bp.blogspot.com/-2cdAHdkLrWM/UYEK3UO9JSI/AAAAAAAAD3g/htI4Y5QRmyI/s72-c/the+square+pattern+print+in+java.jpg" height="72" width="72" /><feedburner:origLink>http://www.hubberspot.com/2013/05/pattern-problems-write-java-program-to_12.html</feedburner:origLink></item><item><title>Pattern problems : Write a Java program to print same character on each line and having character printed in Inverted V shape form.</title><link>http://feedproxy.google.com/~r/LearnJavaByExamples/~3/XSZIyv4vi6Q/pattern-problems-write-java-program-to_11.html</link><category>ICSE Exam Questions</category><category>Java Source Code</category><author>noreply@blogger.com (jontymagicman)</author><pubDate>Sat, 11 May 2013 04:30:01 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7221851061679184814.post-6722228944587732751</guid><description>
Program to Pattern problems : Write a Java program to print same  character on each line and having character printed in Inverted V Shape form. As  shown below : 


    *
   * *
  *   *
 *     *
*       *  

   


package com.hubberspot.patterns.problems;

import java.util.Scanner;

public class InvertedVPattern {

    public static void main(String[] args) {

        String pattern;
        int</description><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-11T17:00:01.961+05:30</app:edited><media:thumbnail url="http://4.bp.blogspot.com/-91MqE2bl7kI/UYAqYe0l2aI/AAAAAAAAD3Q/ZljiRfEqoRk/s72-c/the+inverted+v+pattern+print+in+java.jpg" height="72" width="72" /><feedburner:origLink>http://www.hubberspot.com/2013/05/pattern-problems-write-java-program-to_11.html</feedburner:origLink></item><item><title>Pattern problems : Write a Java program to print same character on each line and having character printed in V shape form.</title><link>http://feedproxy.google.com/~r/LearnJavaByExamples/~3/GiWVP4d3Bto/pattern-problems-write-java-program-to_10.html</link><category>ICSE Exam Questions</category><category>Java Source Code</category><author>noreply@blogger.com (jontymagicman)</author><pubDate>Fri, 10 May 2013 07:38:00 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7221851061679184814.post-5300578995446420228</guid><description>
Program to Pattern problems : Write a Java program to print same character on each line and having character printed in V Shape form. As shown below : 


*                                *
   *                          *
      *                    *
          *            *      
              *    *
                 *
  

  

  
package com.hubberspot.patterns.problems;

import </description><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-10T20:08:00.241+05:30</app:edited><media:thumbnail url="http://3.bp.blogspot.com/-M0Kpx63rBYY/UX7VIO_MRBI/AAAAAAAAD3A/FSMHGf6zMqg/s72-c/the+v+pattern+print+in+java.jpg" height="72" width="72" /><feedburner:origLink>http://www.hubberspot.com/2013/05/pattern-problems-write-java-program-to_10.html</feedburner:origLink></item><item><title>Pattern problems : Write a Java program to print same character on each line and having character printed in diagonal form.</title><link>http://feedproxy.google.com/~r/LearnJavaByExamples/~3/Z19j2GurawY/pattern-problems-write-java-program-to_9.html</link><category>ICSE Exam Questions</category><category>Java Source Code</category><author>noreply@blogger.com (jontymagicman)</author><pubDate>Thu, 09 May 2013 05:05:00 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7221851061679184814.post-4656547909374157527</guid><description>Program to Pattern problems : Write a Java program to print same character on each line and having character printed in diagonal form. As shown below : 

*
     *
          *
               *
                    *
                         *

  

package com.hubberspot.patterns.problems;

import java.util.Scanner;

public class DiagonalPattern {

    public static void main(String[] args) {

</description><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-09T17:35:00.959+05:30</app:edited><media:thumbnail url="http://2.bp.blogspot.com/-4uuhgerHir0/UX1AB3BfUfI/AAAAAAAAD2w/giMk9LStXqU/s72-c/diagonal+pattern+on+seperate+lines.jpg" height="72" width="72" /><feedburner:origLink>http://www.hubberspot.com/2013/05/pattern-problems-write-java-program-to_9.html</feedburner:origLink></item><item><title>Pattern problems : Write a Java program to print different character on each line and having character increment with each line. </title><link>http://feedproxy.google.com/~r/LearnJavaByExamples/~3/M8w0pZz7wco/pattern-problems-write-java-program-to_8.html</link><category>ICSE Exam Questions</category><category>Java Source Code</category><author>noreply@blogger.com (jontymagicman)</author><pubDate>Wed, 08 May 2013 05:04:00 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7221851061679184814.post-6932118914946399417</guid><description>Program to Pattern problems : Write a Java program to print different character on each line and having character increment with each line. As shown below :

1
22
333
4444
55555
666666

  

package com.hubberspot.patterns.problems;

import java.util.Scanner;

public class MultipleLineDifferentPattern {

    public static void main(String[] args) {

        int pattern;
        int noOfTimes;

</description><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-08T17:34:00.064+05:30</app:edited><media:thumbnail url="http://4.bp.blogspot.com/-63KktIHSb5Y/UX0_yym6bWI/AAAAAAAAD2o/U4DzLIulJPk/s72-c/different+character+on+seperate+lines+pattern.jpg" height="72" width="72" /><feedburner:origLink>http://www.hubberspot.com/2013/05/pattern-problems-write-java-program-to_8.html</feedburner:origLink></item><item><title>Pattern problems : Write a Java program to print same character on each line and having character increment with each line. </title><link>http://feedproxy.google.com/~r/LearnJavaByExamples/~3/Dw3F9pHMTxg/pattern-problems-write-java-program-to.html</link><category>ICSE Exam Questions</category><category>Java Source Code</category><author>noreply@blogger.com (jontymagicman)</author><pubDate>Tue, 07 May 2013 05:04:00 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7221851061679184814.post-438031157837827562</guid><description>Program to Pattern problems : Write a Java program to print same character on each line and having character increment with each line. As shown below : 

*
**
***
****
*****
******

  

package com.hubberspot.patterns.problems;

import java.util.Scanner;

public class MultipleLinePattern {
 
 public static void main(String[] args) {
  
     String pattern;
     int noOfTimes;
     
     Scanner </description><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-07T17:34:00.272+05:30</app:edited><media:thumbnail url="http://4.bp.blogspot.com/-vLx_s8KjxF4/UX0_mGRxQeI/AAAAAAAAD2g/lnH2LhHAb-w/s72-c/same+character+on+seperate+lines+pattern.jpg" height="72" width="72" /><feedburner:origLink>http://www.hubberspot.com/2013/05/pattern-problems-write-java-program-to.html</feedburner:origLink></item><item><title>Write a program to print the sum of negative numbers, sum of positive even numbers and the sum of positive odd numbers from a list of numbers (N) entered by the user. The list terminates when the user enters a zero.</title><link>http://feedproxy.google.com/~r/LearnJavaByExamples/~3/lJhZ36TJSoQ/write-program-to-print-sum-of-negative.html</link><category>ICSE Exam Questions</category><category>Java Source Code</category><author>noreply@blogger.com (jontymagicman)</author><pubDate>Mon, 06 May 2013 05:04:00 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7221851061679184814.post-2316846212538560770</guid><description>
Program to print the sum of negative numbers, sum of positive even numbers and the sum of positive odd numbers from a list of numbers (N) entered by the user. The list terminates when the user enters a zero in Java.  

package com.hubberspot.java.example;

import java.util.Scanner;

public class SumArray {

    public static void main(String[] args) {

        Scanner scanner = new Scanner(</description><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-06T17:34:00.498+05:30</app:edited><media:thumbnail url="http://2.bp.blogspot.com/--PmL3ak3_Xg/UX08mi0irZI/AAAAAAAAD2Q/nmcWWKmjIKM/s72-c/sum+of+odd+,+even+and+negative+numbers+together.jpg" height="72" width="72" /><feedburner:origLink>http://www.hubberspot.com/2013/05/write-program-to-print-sum-of-negative.html</feedburner:origLink></item><item><title>Write a Java program to print Padovan Sequence.</title><link>http://feedproxy.google.com/~r/LearnJavaByExamples/~3/Z_Pew168LAc/write-java-program-to-print-padovan.html</link><category>ICSE Exam Questions</category><category>Java Source Code</category><author>noreply@blogger.com (jontymagicman)</author><pubDate>Sun, 05 May 2013 05:04:00 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7221851061679184814.post-8636149250378970109</guid><description>
Program to implement Padovan sequence in Java.  

The Padovan Sequence starts with three 1's and after that moves on with a function as : f(x) = f(x-2)+ f(x-3).

package com.hubberspot.java.sequences;

import java.util.Scanner;

public class Padovan {

    public static void main(String[] args) {
        
        int firstNumber = 1;
        int secondNumber = 1;
        int thirdNumber = 1;
</description><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-05T17:34:00.185+05:30</app:edited><media:thumbnail url="http://4.bp.blogspot.com/-yFJH9gRyExw/UX03_tix_-I/AAAAAAAAD2A/WoMT0nc-GFA/s72-c/padovan+sequence+in+java.jpg" height="72" width="72" /><feedburner:origLink>http://www.hubberspot.com/2013/05/write-java-program-to-print-padovan.html</feedburner:origLink></item><item><title>Write a Java program to print Jacobsthal Sequence.</title><link>http://feedproxy.google.com/~r/LearnJavaByExamples/~3/gitbQwoXro8/write-java-program-to-print-jacobsthal.html</link><category>ICSE Exam Questions</category><category>Java Source Code</category><author>noreply@blogger.com (jontymagicman)</author><pubDate>Sat, 04 May 2013 05:04:00 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7221851061679184814.post-7144148469491216472</guid><description>
Program to implement Jacobsthal sequence in Java.

The Jacobsthal sequence starts with numbers 0 and 1. After that each successive number is sum of previous number plus twice the number previous to previous number. 

package com.hubberspot.java.sequences;

import java.util.Scanner;

public class Jacobsthal {

    public static void main(String[] args) {
       
        int firstNumber = 0;
</description><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-04T17:34:00.326+05:30</app:edited><media:thumbnail url="http://2.bp.blogspot.com/-1b51q3sRSDk/UX022EjIjxI/AAAAAAAAD10/XjHe_qveMcE/s72-c/jacobsthal+sequence+in+java.jpg" height="72" width="72" /><feedburner:origLink>http://www.hubberspot.com/2013/05/write-java-program-to-print-jacobsthal.html</feedburner:origLink></item><item><title>Write a menu‐driven class to accept a number from the user and check whether it is a Automorphic number or not in Java.</title><link>http://feedproxy.google.com/~r/LearnJavaByExamples/~3/hGQY343cYfc/write-menudriven-class-to-accept-number.html</link><category>ICSE Exam Questions</category><category>Java Source Code</category><author>noreply@blogger.com (jontymagicman)</author><pubDate>Fri, 03 May 2013 05:05:00 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7221851061679184814.post-682655041837737378</guid><description>
Program to demonstrate a menu‐driven class to accept a number from the user and check whether it is a Automorphic number or not in Java.   

package com.hubberspot.java.example;

import java.util.Scanner;

public class AutomorphicTest {

    public static void main(String[] args) {

        char program;
        Scanner scanner = new Scanner(System.in);
        do { 

            </description><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-03T17:35:00.274+05:30</app:edited><media:thumbnail url="http://2.bp.blogspot.com/-pxOm60sSBqU/UX0Umw0qxVI/AAAAAAAAD1g/UI2DGYNmYN0/s72-c/Automorphic+test+of+a+number+in+java.jpg" height="72" width="72" /><feedburner:origLink>http://www.hubberspot.com/2013/05/write-menudriven-class-to-accept-number.html</feedburner:origLink></item><item><title>Write a program to calculate and print the sum of the following series: Sum(x) = x/2 + x/5 + x/8 + … + x/100.</title><link>http://feedproxy.google.com/~r/LearnJavaByExamples/~3/SgkhmWqdh98/write-program-to-calculate-and-print_2.html</link><category>ICSE Exam Questions</category><category>Java Source Code</category><author>noreply@blogger.com (jontymagicman)</author><pubDate>Thu, 02 May 2013 05:04:00 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7221851061679184814.post-8233225552952474000</guid><description>
Program to calculate and print the sum of the following series: Sum(x) = x/2 + x/5 + x/8 + … + x/100 in Java.  

package com.hubberspot.java.series.problems;

import java.util.Scanner;

public class Series {

    public static void main(String[] args) {
        
        Scanner scanner = new Scanner(System.in);
        
        System.out.println("Enter the value of x : ");
        
        </description><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-02T17:34:00.325+05:30</app:edited><media:thumbnail url="http://4.bp.blogspot.com/-zX0--Oqw3Uc/UX0Sun9aWLI/AAAAAAAAD1U/jO4_NbFsQ0o/s72-c/sum+of+series+2+in+java+program.jpg" height="72" width="72" /><feedburner:origLink>http://www.hubberspot.com/2013/05/write-program-to-calculate-and-print_2.html</feedburner:origLink></item><item><title>Write a program to calculate and print the sum of the following series:  Sum(x) = 2 – 4 + 6 – 8 + 10 - 12 … - 100</title><link>http://feedproxy.google.com/~r/LearnJavaByExamples/~3/u7sTnbJYXTU/write-program-to-calculate-and-print.html</link><category>ICSE Exam Questions</category><category>Java Source Code</category><author>noreply@blogger.com (jontymagicman)</author><pubDate>Wed, 01 May 2013 06:55:00 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7221851061679184814.post-5751471371665396999</guid><description>
Program to demonstrate how to calculate and print the sum of the following series:  
Sum(x) = 2 – 4 + 6 – 8 + 10 - 12 … - 100 in Java.  

package com.hubberspot.java.series.problems;

public class Series {

    public static void main(String[] args) {

        int sumOfSeries = 0;
        
        int i = 2;
        
        while( i &amp;lt;= 100 ) {
            
            if(i % 4 == 0) { 
</description><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-01T19:25:00.894+05:30</app:edited><media:thumbnail url="http://3.bp.blogspot.com/-IpWIzvK7Oy4/UXvZ40f-VHI/AAAAAAAAD1E/BH3oKzz0Tsk/s72-c/sum+of+series+in+java+program.jpg" height="72" width="72" /><feedburner:origLink>http://www.hubberspot.com/2013/05/write-program-to-calculate-and-print.html</feedburner:origLink></item><item><title>How to convert Decimal number to Binary number and vice versa in Java ?.</title><link>http://feedproxy.google.com/~r/LearnJavaByExamples/~3/bgvJyV15PEc/how-to-convert-decimal-number-to-binary.html</link><category>Java Source Code</category><author>noreply@blogger.com (jontymagicman)</author><pubDate>Tue, 30 Apr 2013 05:30:05 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7221851061679184814.post-1878598703631802749</guid><description>
Program to implement how to convert Decimal number to Binary number and vice versa in Java.  

package com.hubberspot.convertors;

public class DecimalToBinary {

 public static void main(String[] args) {

  // Create a decimal number
  int decimalNumber = 345;

  // In order to convert a number from decimal
  // to binary we use Integer class static method 
  // toBinaryString() , it returns </description><app:edited xmlns:app="http://www.w3.org/2007/app">2013-04-30T18:00:05.056+05:30</app:edited><media:thumbnail url="http://4.bp.blogspot.com/-G5DkudwhTV8/UXLyLViekgI/AAAAAAAAD0U/iATfNKgSrAE/s72-c/decimal+to+binary+number+in+Java.jpg" height="72" width="72" /><feedburner:origLink>http://www.hubberspot.com/2013/04/how-to-convert-decimal-number-to-binary.html</feedburner:origLink></item><item><title>How to display or get list of months names in Java ?.</title><link>http://feedproxy.google.com/~r/LearnJavaByExamples/~3/5iAF0LL4kt4/how-to-display-or-get-list-of-months.html</link><category>Java Source Code</category><author>noreply@blogger.com (jontymagicman)</author><pubDate>Mon, 29 Apr 2013 05:30:05 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7221851061679184814.post-6909782224031964586</guid><description>
Program to implement how to display or get list of months names in Java  

package com.hubberspot.lists;

import java.text.DateFormatSymbols;

public class MonthsListDemo {

 public static void main(String[] args) {

  // Create a DateFormatSymbols instance 
  DateFormatSymbols dfs = new DateFormatSymbols();

  // DateFormatSymbols instance has a method by name
  // getMonths() which returns </description><app:edited xmlns:app="http://www.w3.org/2007/app">2013-04-29T18:00:05.506+05:30</app:edited><media:thumbnail url="http://3.bp.blogspot.com/-oJKA6W-uRzY/UXLR2FBbxcI/AAAAAAAAD0M/RNNTdBBO4-4/s72-c/months+list+print+in+java+using+dateformatsymbols+class.jpg" height="72" width="72" /><feedburner:origLink>http://www.hubberspot.com/2013/04/how-to-display-or-get-list-of-months.html</feedburner:origLink></item><item><title>Write a menu‐driven class to accept a number from the user and check whether it is a Perfect number or not in Java.</title><link>http://feedproxy.google.com/~r/LearnJavaByExamples/~3/Cl-RF2k9F5c/write-menudriven-class-to-accept-number_28.html</link><category>ICSE Exam Questions</category><category>Java Source Code</category><author>noreply@blogger.com (jontymagicman)</author><pubDate>Sun, 28 Apr 2013 05:22:00 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7221851061679184814.post-2455678505656432477</guid><description>
Program to demonstrate a menu‐driven class to accept a number from the user and check whether it is a Perfect number or not in Java.  

Perfect number – a number is called a Perfect number if it is equal to the sum of its factors other
than the number itself. Example: 6 = 1 + 2 + 3.

package com.hubberspot.java.example;

import java.util.Scanner;

public class PerfectNumberTest {


    public </description><app:edited xmlns:app="http://www.w3.org/2007/app">2013-04-28T17:52:00.380+05:30</app:edited><media:thumbnail url="http://1.bp.blogspot.com/-XKVG58j8R6g/UXvDq0_4IVI/AAAAAAAAD00/0nxrEoiD3aw/s72-c/Perfect+number+test+of+a+number+in+java.jpg" height="72" width="72" /><feedburner:origLink>http://www.hubberspot.com/2013/04/write-menudriven-class-to-accept-number_28.html</feedburner:origLink></item><item><title>Write a menu‐driven class to accept a number from the user and check whether it is a Palindrome number or not in Java.</title><link>http://feedproxy.google.com/~r/LearnJavaByExamples/~3/Uf6iKT_Jd2A/write-menudriven-class-to-accept-number.html</link><category>ICSE Exam Questions</category><category>Java Source Code</category><author>noreply@blogger.com (jontymagicman)</author><pubDate>Sat, 27 Apr 2013 05:02:37 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7221851061679184814.post-2393101455953486701</guid><description>
Program to demonstrate a menu‐driven class to accept a number from the user and check whether it is a Palindrome number or not in Java.  

Palindrome number – a number is a Palindrome which when read in reverse order is same as read
in the right order. Example: 121, 11, 15451, etc.

package com.hubberspot.java.example;

import java.util.Scanner;

public class PalindromeTest {

    public static </description><app:edited xmlns:app="http://www.w3.org/2007/app">2013-04-27T17:32:37.470+05:30</app:edited><media:thumbnail url="http://3.bp.blogspot.com/-7ZgVZEFApgk/UXu91n4MJgI/AAAAAAAAD0k/4c_7vtvIHwI/s72-c/Palindrome+test+of+a+number+in+java.jpg" height="72" width="72" /><feedburner:origLink>http://www.hubberspot.com/2013/04/write-menudriven-class-to-accept-number.html</feedburner:origLink></item><item><title>How to display or get list of week days names in Java ?.</title><link>http://feedproxy.google.com/~r/LearnJavaByExamples/~3/Z2IL3D_u_B4/how-to-display-or-get-list-of-week-days.html</link><category>Java Source Code</category><author>noreply@blogger.com (jontymagicman)</author><pubDate>Fri, 26 Apr 2013 05:30:04 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-7221851061679184814.post-4156733657282128239</guid><description>
Program to implement how to display or get list of week days names in Java  

package com.hubberspot.lists;

import java.text.DateFormatSymbols;

public class WeekDaysList {

	public static void main(String[] args) {

		// Create a DateFormatSymbols instance
		DateFormatSymbols dfs = new DateFormatSymbols();

		// DateFormatSymbols instance has a method by name
		// getWeekdays() which returns </description><app:edited xmlns:app="http://www.w3.org/2007/app">2013-04-26T18:00:04.095+05:30</app:edited><media:thumbnail url="http://3.bp.blogspot.com/-_rDQdDUtTdE/UXLRvNWv38I/AAAAAAAAD0E/zmRThxR4mfw/s72-c/week+days+list+print+in+java+using+dateformatsymbols+class.jpg" height="72" width="72" /><feedburner:origLink>http://www.hubberspot.com/2013/04/how-to-display-or-get-list-of-week-days.html</feedburner:origLink></item><media:rating>nonadult</media:rating></channel></rss>
