Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Core Java Projects with complete source code

NotificationsYou must be signed in to change notification settings

sathishmepco/Java-Interview-Programs

Repository files navigation

Basic Programs

  1. Check the given number isEVEN or ODD.[Solution]
  2. Write a Java Program to find theFactorial of given number.[Solution]
  3. Find theFactorial of a number usingRecursion.[Solution]
  4. Swap two numbers without using third variable approach 1.[Solution]
  5. Swap two numbers without using third variable approach 2.[Solution]
  6. Swap two numbers without using third variable approach 3.[Solution]
  7. How to check the given number isPositive or Negative in Java?[Solution]
  8. Write a Java Program to find whether given number isLeap year or NOT?[Solution]
  9. Write a Java Program to Print 1 To 10 Without Using Loop.[Solution]
  10. Write a Java Program to print thedigits of a Given Number.[Solution]
  11. Write a Java Program to print all theFactors of the Given number.[Solution]
  12. Write a Java Program to findsum of the digits of a given number.[Solution]
  13. Write a Java Program tofind the smallest of 3 numbers (a,b,c) without using < or > symbol?[Solution]
  14. How to add two numbers without using the arithmetic operators in Java?[Solution]
  15. Write a java program toReverse a given number.[Solution]

Numbers

  1. Write a Java Program to find GCD of two given numbers.[Solution]
  2. Write a java program toLCM of TWO given number.[Solution]
  3. Write a java program toLCM of TWO given number using Prime Factors method.[Solution]
  4. Check whether theGiven Number is aPalindrome or NOT.[Solution]
  5. Write a Java Program to print all thePrime Factors of the Given Number.[Solution]
  6. Write a Java Program to check whether the Given Number isPrime Number or NOT.[Solution]
  7. Write a Java Program to printPrime Numbers from 1 to N.[Solution]
  8. Write a Java Program to check whether the given number isArmstrong Number or NOT.[Solution]
  9. Write a Java Program to printArmstrong Numbers between 1 to 1000.[Solution]
  10. Write a Java Program to check whether the given number isPerfect Number or NOT.[Solution]
  11. Write a Java Program to printPerfect Numbers between 1 to 1000.[Solution]
  12. Write a Java Program to check whether the given numbers areAmicable Numbers or NOT.[Solution]
  13. Write a Java Program to check whether the given number isRamanujam's Number or NOT.[Solution]
  14. Write a Java Program check whether the given number isAutomorphic Number or NOT.[Solution]
  15. Write a Java Program to printAutomorphic Number between 1 to 1000.[Solution]
  16. Write a Java Program check whether the given number isSmith Number or NOT.[Solution]
  17. Write a Java Program to printSmith Number between 2 to 1000.[Solution]
  18. Write a Java Program to check whether given number isKaprekar Number or NOT.[Solution]
  19. Write a Java Program to printKaprekar Numbers between 1 to 1000.[Solution]
  20. Find theLargest Divisor.[Solution]
  21. Find theAll Divisors of a Given numberN.[Solution]
  22. How to check if two rectangles overlap with each other?

Array Based Programs

  1. Calculate the average of given array.[Solution]
  2. Find the second largest number in the given array.[Solution]
  3. Find the second minimum number in the given array.[Solution]
  4. Find the missing Number in the given array of 1 to N.[Solution]
  5. Write a Java Program to find theIntersection of two arrays.[Solution]
  6. Write a Java Program to find theIntersection of Two Sorted arrays.[Solution]
  7. Write a Java Program to find theUnion of Two Arrays (UnSorted Array).[Solution]
  8. Write a Java Program to find theUnion of Two Arrays (Sorted Arrays).[Solution]
  9. Write a Java Program to find theUnion of Tow Arrays using HashSet.[Solution]
  10. Write a Java Program toMove all Zero to End of the Array.[Solution]
  11. Write a Java Program toMove all Zeros to Start of the Array.[Solution]
  12. Write a Java Program toReverse the given array without using additional Array.[Solution]
  13. Write a program to find theMost Frequent Element in an given array.[Solution]
  14. Write a program to find theMost Frequent Element using Sorting.[Solution]
  15. Write a program to find theMost Frequent Element using HashTable.[Solution]
  16. Write a java program toRotate the Given Array d times.[Solution]
  17. Find the pair of elements(X+Y) in the array whose sum is equal to given number Z.[Solution]

String Based Programs

  1. Write a java program to check Given String isPalindrome or NOT.[Solution]
  2. How toSwap two Strings without using third (temporary) variable?[Solution]
  3. Write a java program toReverse a String without using in-build function.[Solution]
  4. Write a java program toCount the Number of Words in a given String.[Solution]
  5. Write a java program toCount the Number of Vowels in the given string.[Solution]
  6. Check Given String isRotation of Another String.[Solution]
  7. Write a Java Program to check two strings areAnagram to each other or NOT.[Solution]
  8. Write a Java program to find theMost Repeated Character in the Given String.[Solution]
  9. How do you count theNumber of Words in a given String usingSplit method?[Solution]
  10. Write a Java Program toPrint All Combinations of a given String.[Solution]
  11. Write a Java Program toPrint All Permutations of a given String.[Solution]
  12. Write a Java Program to findAll Subsets of a Given String usingBitwise approach.[Solution]
  13. Write a Java Program to findAll Subsets of a Given String usingRecursion approach.[Solution]

Converters

  1. Convert Decimal Number to Binary Number.[Solution]
  2. Convert Binary Number to Decimal Number.[Solution]
  3. Convert Decimal Number to Octal Number.[Solution]
  4. Convert Octal Number to Decimal Number.[Solution]
  5. Convert Decimal to Hexadecimal.[Solution]
  6. Convert Hexadecimal to Decimal.[Solution]
  7. Convert Octal to Binary Number.[Solution]
  8. Convert Binary Number to Octal.[Solution]

Sorting

  1. Bubble Sort [Solution]
  2. Quick Sort [Solution]
  3. Selection Sort [Solution]
  4. Insertion Sort [Solution]
  5. Merge Sort [Solution]

Searching

  1. Linear Search [Solution]
  2. Binary Search [Solution]

Matrix

  1. Write a Java Program toAdd two Matrices.[Solution]
  2. Write a Java Program toSubtract Two Matrices.[Solution]
  3. Write a Java Program toTranspose a Matrix.[Solution]
  4. Write a Java Program toMultiply Two Matrices.[Solution]
  5. Write a Java Program to print theMatrix Spiral form.[Solution]
  6. Write a Java Program to check whether aGiven Matrix is an Identity Matrix.[Solution]
  7. Check whether the Given Matrix isSparse Matrix or NOT[Solution]
  8. Display theLower Triangular Matrix[Solution]
  9. Display theUpper Triangular Matrix[Solution]
  10. Find sum of each row and each column of the Matrix.[Solution]

Print the Series

  1. Write the Java Program to print the following seriesEVEN number Series[Solution]
2 4 6 8 10 12 14 16 .....
  1. Write the Java Program to print the following seriesODD number Series[Solution]
1 3 5 7 9 11 13 ....
  1. Write the Java Program to print the following seriesPattern Series[Solution]
3, 33, 333, 3333, 33333, 333333 ....
  1. Write the Java Program to print the following series[Solution]
10 1 9 2 8 3 7 4 6 5 5 6 4 7 3 8 2 9 1 10
  1. Write the Java Program to print the following seriesQuadraticSequence[Solution]
1 2 4 7 11 16 22 29 .....
  1. Write the Java Program to print the following series[Solution]
2 9 28 65 126 217 344
  1. Write the Java Program to print the following seriesGeometric Progression[Solution]
1 2 4 8 16 32 64 128 256 512 1024 ......
  1. Write the Java Program to print the following seriesArithmetic Progression[Solution]
0 5 10 15 20 25 30 35 ....
  1. Write the Java Program to print the following seriesFibonacci Series[Solution]
1 1 2 3 5 8 13 21 34 55 89 .....
  1. Write the Java Program to print the following seriesPrime Number Series[Solution]
2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 .....
  1. Write the Java Program to print the following seriesTriangular Number Series[Solution]
1 3 6 10 15 21 28 36 45 55 .....
  1. Write the Java Program to print the following series
1 2 3 2 3 4 3 4 5 4 5 4 5 6 5 6 5 6 7 ....

Pattern Questions

  1. Write a Program to print Floyd's triangle?[Solution]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
  1. Write a Program to print Pascal's triangle?
  2. Write a Java Program to print the following Pattern[Solution]
          1          1 2          1 2 3          1 2 3 4          1 2 3 4 5          1 2 3 4 5 6
  1. Write a Java Program to print the following Pattern.[Solution]
          1          2 2          3 3 3          4 4 4 4          5 5 5 5 5          6 6 6 6 6 6
  1. Write a Java Program to print the following Pattern.[Solution]
          6 5 4 3 2 1          6 5 4 3 2           6 5 4 3           6 5 4          6 5          6
  1. Write a Java Program to print the following Pattern.[Solution]
          1 2 3 4 5 6          1 2 3 4 5          1 2 3 4          1 2 3          1 2          1
  1. Write a Java Program to print the following Pattern.[Solution]
          1          1 2 1          1 2 3 2 1          1 2 3 4 3 2 1          1 2 3 4 5 4 3 2 1          1 2 3 4 5 6 5 4 3 2 1
  1. Write a Java Program to print the following Pattern.[Solution]
          1 2 3 4 5 6          1 2 3 4 5          1 2 3 4          1 2 3          1 2           1           1 2          1 2 3           1 2 3 4           1 2 3 4 5          1 2 3 4 5 6
  1. Write a Java Program to print the following Pattern.[Solution]
1 2 3 4 5 6  2 3 4 5 6    3 4 5 6      4 5 6 5 6   65 6      4 5 6    3 4 5 6  2 3 4 5 61 2 3 4 5 6
  1. Write a Java Program to print the following Pattern.[Solution]
12 13 2 14 3 2 15 4 3 2 1 6 5 4 3 2 1
  1. Write a Java Program to print the following Pattern.[Solution]
11 01 0 11 0 1 01 0 1 0 11 0 1 0 1 0
  1. Write a Java Program to print the following Pattern.
1 1 1 1 1 11 1 1 1 2 21 1 1 3 3 31 1 4 4 4 41 5 5 5 5 56 6 6 6 6 6
  1. Write a Java Program to print the following Pattern.[Solution]
9 9 9 9 9 9 9 9 9  7 7 7 7 7 7 7    5 5 5 5 5      3 3 3        1
  1. Write a Java Program to print the following Pattern.[Solution]
5 5 5 5 5 5 5 5 5  4 4 4 4 4 4 4    3 3 3 3 3      2 2 2        1
  1. Write a Java Program to print the following Pattern.[Solution]
1 1 1 1 12 2 2 2 23 3 3 3 34 4 4 4 45 5 5 5 5
  1. Write a Java Program to print the following Pattern.[Solution]
        A      A B A    A B C B A  A B C D C B AA B C D E D C B A
  1. Write a Java Program to print the following Pattern.[Solution]
        1      1 2 1    1 2 3 2 1  1 2 3 4 3 2 11 2 3 4 5 4 3 2 1
  1. Write a Java Program to print the following Pattern.[Solution]
        A       B A B    C B A B C  D C B A B C DE D C B A B C D E
  1. Write a Java Program to print the following Pattern.[Solution]
        0       1 0 1    2 1 0 1 2  3 2 1 0 1 2 34 3 2 1 0 1 2 3 4
  1. Write a Java Program to print the following Pattern.[Solution]
        A      C B A    E D C B A  G F E D C B AI H G F E D C B A
  1. Write a Java Program to print the following Pattern.[Solution]
        A      A B C    A B C D E  A B C D E F GA B C D E F G H I
  1. Write a Java Program to print the following Pattern.[Solution]
        1      3 2 1    5 4 3 2 1  7 6 5 4 3 2 19 8 7 6 5 4 3 2 1
  1. Write a Java Program to print the following Pattern.[Solution]
        1      1 2 3    1 2 3 4 5  1 2 3 4 5 6 71 2 3 4 5 6 7 8 9
  1. Write a Java Program to print the following Pattern.[Solution]
        A      C C C    E E E E E  G G G G G G GI I I I I I I I I
  1. Write a Java Program to print the following Pattern.[Solution]
        A      B B B    C C C C C  D D D D D D DE E E E E E E E E
  1. Write a Java Program to print the following Pattern.[Solution]
        1      3 3 3    5 5 5 5 5  7 7 7 7 7 7 79 9 9 9 9 9 9 9 9
  1. Write a Java Program to print the following Pattern.[Solution]
        1      2 2 2    3 3 3 3 3  4 4 4 4 4 4 45 5 5 5 5 5 5 5 5
  1. Write a Java Program to print the following Pattern.[Solution]
        *      * * *    * * * * *  * * * * * * ** * * * * * * * *
  1. Write a Java Program to print the following Pattern.[Solution]
A B C D E  A B C D    A B C      A B        A
  1. Write a Java Program to print the following Pattern.[Solution]
E E E E E  D D D D    C C C      B B        A
  1. Write a Java Program to print the following Pattern.[Solution]
1 2 3 4 5  1 2 3 4    1 2 3      1 2        1
  1. Write a Java Program to print the following Pattern.[Solution]
5 5 5 5 5  4 4 4 4    3 3 3      2 2        1
  1. Write a Java Program to print the following Pattern.[Solution]
* * * * *  * * * *    * * *      * *        *
  1. Write a Java Program to print the following Pattern.[Solution]
        A      A B    A B C  A B C DA B C D E
  1. Write a Java Program to print the following Pattern.[Solution]
        A      B B    C C C  D D D DE E E E E
  1. Write a Java Program to print the following Pattern.[Solution]
        1      1 2    1 2 3  1 2 3 41 2 3 4 5
  1. Write a Java Program to print the following Pattern.[Solution]
        1      2 2    3 3 3  4 4 4 45 5 5 5 5
  1. Write a Java Program to print the following Pattern.[Solution]
        *      * *    * * *  * * * ** * * * *
  1. Write a Java Program to print the following Pattern.[Solution]
E D C B AE D C BE D CE DE
  1. Write a Java Program to print the following Pattern.[Solution]
E E E E ED D D DC C CB BA
  1. Write a Java Program to print the following Pattern.[Solution]
5 4 3 2 15 4 3 25 4 35 45
  1. Write a Java Program to print the following Pattern.[Solution]
5 5 5 5 54 4 4 43 3 32 21
  1. Write a Java Program to print the following Pattern.[Solution]
A B C D EA B C DA B CA BA
  1. Write a Java Program to print the following Pattern.[Solution]
A A A A AB B B BC C CD DE
  1. Write a Java Program to print the following Pattern.[Solution]
1 1 1 1 12 2 2 23 3 34 45
  1. Write a Java Program to print the following Pattern.[Solution]
* * * * ** * * ** * ** **
  1. Write a Java Program to print the following Pattern.[Solution]
AA BA B CA B C DA B C D E
  1. Write a Java Program to print the following Pattern.[Solution]
** ** * ** * * ** * * * *
  1. Write a Java Program to print the following Pattern.[Solution]
AB BC C CD D D DE E E E E
  1. Write a Java Program to print the following Pattern.[Solution]
11 21 2 31 2 3 41 2 3 4 5
  1. Write a Java Program to print the following Pattern.[Solution]
12 23 3 34 4 4 45 5 5 5 5

Brackets or Parentheses Problems

  1. Write a Java Program to find out whether the given string isBalanced Parentheses or NOT?[Solution]
()() - VALID(()) - VALID())( - INVALID((- INVALID
  1. Generate Balanced Parentheses of N pairs.[Solution]
N = 2N= 3()()()()()(())(())()()(())(()())((()))
  1. Generate All possible combinations of Parentheses.
N = 2N= 3()()()()()()(())(())()()()(())()()(())(()())((()))
  1. Count the Number of possible combinations of Parentheses.
N = 2N= 3()()()()()()(())(())Output = 3()()()(())()()(())(()())((()))Output = 8

Java Interview Questions

  1. What do you know about JVM, JRE and JDK?
  2. Is JRE platform dependant or independent?
  3. Which is ultimate base class in java class hierarchy? List the name of methods of it?
  4. Which are the reference types in java?
  5. What is narrowing and widening?
  6. How will you print "Hello CDAC" statement on screen, without semicolon?
  7. Can you write java application without main function? If yes, how?
  8. What will happen, if we call main method in static block?
  9. In System.out.println, What is meaning of every word?
  10. How will you pass object to the function by reference?
  11. What is constructor chaining? How can we achieve it in C++?
  12. Which are the rules to overload method in sub class?
  13. What is the difference between finalize and dispose?
  14. What is shut down hook?
  15. What is the difference between final, finally and finalize?
  16. What is the difference between checked and unchecked exception?
  17. What is exception chaining?
  18. What is the difference between throw and throws?
  19. In which case, finally block doesn’t execute?
  20. What is upcasting?
  21. What is dynamic method dispatch?
  22. What do you know about final method?
  23. What is the difference between abstract class and interface?
  24. What is fragile base class problem and how can we overcome it?
  25. Why java does not support multiple implementation inheritance?
  26. What is marker interface? List the name of some marker interfaces?
  27. What is the significance of marker interface?
  28. What is the difference between Comparable and Comparator?
  29. What is the difference between Array and ArrayList?
  30. What is the difference between HashSet and HashMap?
  31. What is the difference between HashTable and HashMap?
  32. Which collection classes are synchronized?
  33. What is the difference between ArrayList and Vector?
  34. What is the difference between Enumeration and Iterator?
  35. What is the difference between Iterator and ListIterator?
  36. What is the difference between fail-fast and fail-safe iterator?
  37. How can you copy elements of one collection into another without iterator?
  38. What is the difference between String and StringBuffer?
  39. What is the difference between StringBuffer and StringBuilder?
  40. How can you check wheather string is palindrome or not?
  41. Can we write multiple public classes in single .java file? If no why?
  42. What is serialization and deserialization?
  43. If serializable class do not contain serializable fields, what will happen? If its problematic then how will overcome it?
  44. Which two techniques allow us to create new instance from existing one?
  45. Which members do not serialize?
  46. What is metadata? What is advantage of it?
  47. What is bytecode?
  48. What is reflection?
  49. Which features of java makes it platform dependant?
  50. What is applet?
  51. Can you explain life cycle of applet?
  52. Why AWT components are heavy weight component?
  53. What is thread?
  54. Which are the types of thread? What is the difference between them?
  55. Explain life cycle of thread?
  56. What is race condition? How can we overcome it?
  57. What is synchronization? How can we achieve it?
  58. How can we share object between the threads?
  59. Why wait, notify and notifyall methods belongs to Object class instead of Thread class?
  60. What do you know about volatile keyword in java?
  61. What is the difference between Thread. Sleep and Thread.yield?
  62. What is deadlock? How can we avoid it?
  63. Why thread based multitasking is faster than process based multitasking?
  64. When we should use Thread class and Runnable interface to create thread?
  65. What is wild card? Which are the types of it?
  66. What is the difference between TCP and UDP protocol?
  67. What is socket?
  68. When we should use socket and rmi?
  69. How will you write code for linkedlist in java?
  70. What is wrapper class? What is need of it?
  71. What are the various access specifiers for Java classes?
  72. What's the purpose of Static methods and static variables?
  73. What is data encapsulation and what's its significance?
  74. What is a singleton class? Give a practical example of its usage.
  75. What are Loops in Java? What are three types of loops?

[8]ページ先頭

©2009-2025 Movatter.jp