KnpCode
Java, Spring, BigData, Web development tutorials with examples
 
Skip to content
  • Ubuntu
  • Big Data
    • Hadoop Tutorials
  • Java
    • Core Java Tutorials – Beginner
    • Core Java Tutorials – Advanced
    • Java Programs
Home Archive by category "java-programs" (Page 5)

Category: java-programs

Java Program to Check if The Given Strings Are Anagram or Not

UshaK May 24, 2018 December 4, 2018java-programs java-programs 0

In this post we’ll see a Java program to check if the given strings are anagram or not. Two strings are called anagrams if you can get the second string by rearranging all of the  letters in the other string. As example – Keep and Peek, Dormitory and Dirty room,…

Continue reading

Display Armstrong Numbers in Java

UshaK May 24, 2018 December 4, 2018java-programs java-programs 0

This post shows how you can generate and display Armstrong numbers in Java with in the given range. A number is an Armstrong number if it is equal to the sum of its digit raised to the power of count of digits in the number. As example – 371 =…

Continue reading

Java Program to Check if Armstrong Number

UshaK May 23, 2018 September 11, 2018java-programs java-programs 1

In this post we’ll see a Java program to check if the passed number is an Armstrong number or not. A number is an Armstrong number if it is equal to the number you get by raising every digit of the number to the power of count of digits in…

Continue reading

Display Prime Numbers in Java

UshaK May 23, 2018 December 3, 2018java-programs java-programs 0

This post shows how you can generate and display prime numbers in Java in the given range. A number is a prime number if can be divided either by 1 or by the number itself. So every number with in the given range has to be divided starting from 2…

Continue reading

Remove Element From an Array in Java

UshaK May 23, 2018 December 3, 2018java-programs java-programs 0

In this post we’ll see how to remove or delete element from an array in Java. You have several options to do that task of removing an element from an array. Write your own logic. Use ArrayList to remove an element. You will need to convert array to ArrayList and…

Continue reading

Matrix Subtraction Java Program

UshaK May 22, 2018 December 3, 2018java-programs java-programs 0

This post shows a Java program to subtract two matrices. When you subtract two matrices you subtract the element at the same index in both matrices so you’ll subtract the element at index (0, 0) in the first matrix with the element at index (0, 0) in the second matrix…

Continue reading

Java Program to Find Longest Palindrome in The Given String

UshaK May 22, 2018 November 30, 2018java-programs java-programs 0

In this post we’ll see a Java program to find the longest palindrome in the given string. In the given string there may be more than one palindromes but you need to find which one is the longest and display that one. For finding the longest palindrome in the string…

Continue reading

Matrix Addition Java Program

UshaK May 21, 2018 November 30, 2018java-programs java-programs 0

This post shows a Java program to add two matrices. When you add two matrices you add the element at the same index in both matrices so you’ll add the element at index (0, 0) in the first matrix with the element at index (0, 0) in the second matrix…

Continue reading

Java Program to Check Whether Number Prime or Not

UshaK May 20, 2018 September 14, 2018java-programs java-programs 1

This post shows a Java program to check whether the passed number is a prime number or not. A number is a prime number if can be divided either by 1 or by the number itself. So the logic for your program should be to run a for loop and…

Continue reading

Java Program to Swap Two Numbers Without Using Third Variable

UshaK May 19, 2018 September 11, 2018java-programs java-programs 0

Given two int variables write a Java program to swap the values of the variables without using third variable is one question asked in many interviews. In this post we’ll see one way of doing that. Logic used here is to add both the variables and hold that value in…

Continue reading

«‹3456›
  • Content Menu

    Java Programs
    String
    Count Frequency of Each Character in a String
    Java Program to Count Number of Words in a String
    Find Duplicate Characters in a String
    Check Given String Palindrome or Not in Java
    Java Program to Find Longest Palindrome in The Given String
    Java Program to Check if The Given Strings Are Anagram or Not
    How to Split a String in Java
    How to Reverse a String in Java
    Java Program to Reverse Each Word in a String
    Find Length of String Without Using length() Method in Java
    Find First Non-Repeated Character in The Given String
    Check if Given String Subsequence of Another String in Java
    Convert Char to String And String to Char in Java
    Convert String to Byte Array in Java
    How to Convert String to int in Java
    Convert String to float in Java
    Convert String to double in Java
    Java Programs For Displaying Patterns
    Numbers
    Check Given Number Palindrome or Not in Java
    Java Program to Check Whether Number Prime or Not
    Display Prime Numbers in Java
    How to Reverse a Number in Java
    Java Program to Swap Two Numbers Without Using Third Variable
    Java Program to Check if Armstrong Number
    Display Armstrong Numbers in Java
    Factorial Program in Java
    Fibonacci Series Java Program
    Arrange Given Numbers to Form Biggest Number in Java
    Java Program to Convert Numbers to Words
    Convert int to String in Java
    Convert float to String in Java
    Convert double to String in Java
    How to Convert float to int in Java
    How to Convert double to int in Java
    Array
    Matrix Multiplication Java Program
    Matrix Addition Java Program
    Matrix Subtraction Java Program
    Find Maximum And Minimum Number in a Matrix
    Remove Element From an Array in Java
    Remove Duplicates From an Array in Java
    Find Common Element Between Two Arrays in Java
    Find Max And Min Values in an Array
    Find Largest And Second Largest Element of an Array in Java
    Java I/O
    How to Read File in Java
    How to Write to a File in Java
    How to Append to a File in Java
    How to Read Delimited File in Java
    How to Read Input From Console in Java
    How to List All The Files in a Directory in Java
    How to Convert File to Byte Array in Java
    How to Get The Last Modified Date of a File in Java
    How to Zip Files in Java
    How to Zip a Folder in Java
    How to Unzip a File in Java
    Java Multithreading
    Print Odd Even Numbers Using Threads
    Print Numbers Sequentially Using Three Threads in Java
    Producer-Consumer Problem Java Program
    How to Create a Deadlock in Java
    Generating PDF Using Java
    Creating PDF From XML Using Apache FOP
  • Like us on facebook

    Knpcode
  • Recent Posts

    • Print Numbers Sequentially Using Three Threads in Java
    • Method Reference in Java
    • Exception Handling With Java Lambda Expressions
    • How to Create a Deadlock in Java
    • Producer-Consumer Problem Java Program
  • Archives

    • February 2019
    • January 2019
    • December 2018
    • November 2018
    • October 2018
    • September 2018
    • August 2018
    • July 2018
    • June 2018
    • May 2018
    • April 2018
    • March 2018
    • February 2018
    • January 2018
  • Meta

    • Log in
    • Entries RSS
    • Comments RSS
    • WordPress.org
Privacy Policy | Disclaimer
Powered by Nirvana & WordPress.
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkPrivacy Policy