Thursday, 13 July 2017

Java Programs in java ~ foundjava

Java programs are frequently asked in the interview. These programs can be asked from control statements, array, string, oops etc. Let's see the list of java programs.

1) Fibonacci series

Write a java program to print fibonacci series without using recursion and using recursion.
Input: 10
Output: 0 1 1 2 3 5 8 13 21 34

2) Prime number

Write a java program to check prime number.
Input: 44
Output: not prime number
Input: 7
Output: prime number

3) Palindrome number

Write a java program to check palindrome number.
Input: 329
Output: not palindrome number
Input: 12321
Output: palindrome number

4) Factorial number

Write a java program to print factorial of a number.
Input: 5
Output: 120
Input: 6
Output: 720

5) Armstrong number

Write a java program to check Armstrong number.
Input: 153
Output: Armstrong number
Input: 22
Output: not Armstrong number


6) Bubble Sort

Write a java program to sort an array elements using bubble sort algorithm.
Input: 18 9 33 4 84 32
Output: 4 9 18 32 33 84

7) Selection Sort

Write a java program to sort an array elements using selection sort algorithm.
Input: 18 9 33 4 84 32
Output: 4 9 18 32 33 84

8) Insertion Sort

Write a java program to sort an array elements using insertion sort algorithm.
Input: 18 9 33 4 84 32
Output: 4 9 18 32 33 84

15 comments:

  1. Hi,

    Very useful article on java programs. Thanks for sharing.

    Cheers,
    http://www.flowerbrackets.com/bubble-sort-program-in-java/

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. This comment has been removed by the author.

    ReplyDelete
  5. This comment has been removed by the author.

    ReplyDelete
  6. This comment has been removed by the author.

    ReplyDelete
  7. This comment has been removed by the author.

    ReplyDelete
  8. This comment has been removed by the author.

    ReplyDelete
  9. Nice article.
    Thanks,
    https://www.flowerbrackets.com/insertion-sort-java/

    ReplyDelete
  10. Awesome!! You got the best questions and answers for java interview. You're doing a great job.

    Thanks for sharing.
    https://www.flowerbrackets.com/factorial-program-in-java/

    ReplyDelete
  11. Links in your blog were very useful. Thanks for sharing.

    Cheers,
    https://www.flowerbrackets.com/java-program-to-check-armstrong-number/

    ReplyDelete
  12. All the links provided in this article were very helpful. You have the best article on this topic.

    Thanks for sharing.
    https://www.flowerbrackets.com/selection-sort-java/

    ReplyDelete
  13. Your blog has best collection of java interview programs. Was very useful. Thanks for sharing.

    Cheers,
    https://www.flowerbrackets.com/java-program-check-whether-string-palindrome/

    ReplyDelete
  14. Links mentioned in your blog were very useful in my interview. Thanks for sharing.

    Cheers,
    https://www.flowerbrackets.com/java-program-to-check-whether-number-is-prime-or-not/

    ReplyDelete
  15. Great blog!! Awesome java programs with best explanation. Thanks for sharing.

    Cheers,
    https://www.flowerbrackets.com/java-program-check-if-number-is-palindrome-or-not/

    ReplyDelete