Here is a compilation of most frequently asked Java programs for interviews. These programs are generally asked in technical rounds or coding rounds.
You are more than welcome to suggest other solutions for the below listed Java programs. To suggest a solution, click the Java program link and write your program / solution as a comment.
Java Programs List
Applets
- Applet program to handle mouse events
- Applet program to display file content
- Applet program to draw lines, ovals, and rectangles
Arrays
- Sorting an array in Java
- Java program to find the maximum and minimum value of an array
- Java program to reverse the array inplace
- Basic array programs in Java
- Java program for matrix multiplication and matrix transpose
Basic Programs
- Java program to add two numbers
- Java program to print Fibonacci series up to n terms
- Java program to print the nth element in the Fibonacci series
- Java program to find the factorial of a number using recursion
- Java program to find given number is palindrome or not
- Java program to compute the sum of digits in a given integer
- Java program to print even numbers in the range 1 to n
- Java program to find the reverse of a given number
- Java program to generate random numbers
- Java program to print sum of first n natural numbers
- Java program to check whether the number is an armstrong number or not
- Java program to print odd numbers in the range 1 to n
- Java program to print prime numbers from 1 to n
- Java program to check if a given character is vowel or consonant
Files
- Java program for displaying file information
- Java program to display the number of characters lines and words in a text file
Inheritance
- Java program on shape hierarchy
- Java program that illustrates how runtime polymorphism is achieved
- Java program on rodent hierarchy
Strings
- Java program to remove duplicate characters from a string
- Java program to display integers and sum using StringTokenizer
- Java program to print all unique words of a string
- Java program for sorting a given list of names in ascending order
- Java program that checks whether a given string is a palindrome or not
- Java program to print only unique characters in a string
- Java program to print the frequency of characters in a string
Threads
Suryateja Pericherla, at present is a Research Scholar (full-time Ph.D.) in the Dept. of Computer Science & Systems Engineering at Andhra University, Visakhapatnam. Previously worked as an Associate Professor in the Dept. of CSE at Vishnu Institute of Technology, India.
He has 11+ years of teaching experience and is an individual researcher whose research interests are Cloud Computing, Internet of Things, Computer Security, Network Security and Blockchain.
He is a member of professional societies like IEEE, ACM, CSI and ISCA. He published several research papers which are indexed by SCIE, WoS, Scopus, Springer and others.
Leave a Reply