Learn Code With Durgesh LogoLCWD
HomeCoursesBlogsContact Us
HomeCoursesBlogsContact Us
LearnCodeWithDurgesh Logo

Learn Code With Durgesh

Offering free & premium coding courses to lakhs of students via YouTube and our platform.

Explore

  • About Us
  • Courses
  • Blog
  • Contact

Legal

  • Privacy Policy
  • Terms & Conditions
  • Refund Policy
  • Support

Contact

  • 📞 +91-9839466732
  • [email protected]
  • Substring Technologies, 633/D/P256 B R Dubey Enclave Dhanwa Deva Road Matiyari Chinhat, Lucknow, UP, INDIA 226028
© 2025 Made with ❤️ by Substring Technologies. All rights reserved.
TOP 100 CORE JAVA PRACTICE QUESTIONS

TOP 100 CORE JAVA PRACTICE QUESTIONS

By durgesh • Fri Jul 05 2024

TOP 100 CORE JAVA PRACTICE QUESTIONS

✅TOP 100 CORE JAVA PRACTICE QUESTIONS

Here are top 100 core java practical questions mostly asked in interview.

Conditional Statements

  1. Write a program to check if a number is positive, negative, or zero.
  2. Write a program to find the largest of three numbers.
  3. Write a program to check if a number is even or odd.
  4. Write a program to check if a character is a vowel or consonant.
  5. Write a program to check if a year is a leap year or not.
  6. Write a program to check if a number is prime.
  7. Write a program to find the greatest of three numbers using the ternary operator.
  8. Write a program to check if a number is a palindrome.
  9. Write a program to check if a string is a palindrome.
  10. Write a program to print the day of the week based on a number (1-7).

Patterns

  1. Write a program to print a pyramid pattern.
  2. Write a program to print a reverse pyramid pattern.
  3. Write a program to print a right-angled triangle pattern.
  4. Write a program to print an inverted right-angled triangle pattern.
  5. Write a program to print a diamond pattern.
  6. Write a program to print a hollow square pattern.
  7. Write a program to print a hollow triangle pattern.
  8. Write a program to print a Pascal's triangle.
  9. Write a program to print a Floyd's triangle.
  10. Write a program to print a butterfly pattern.

Series

  1. Write a program to print the Fibonacci series up to a given number.
  2. Write a program to print the factorial of a number.
  3. Write a program to print the sum of the first n natural numbers.
  4. Write a program to print the sum of the first n odd numbers.
  5. Write a program to print the sum of the first n even numbers.
  6. Write a program to print the prime numbers in a given range.
  7. Write a program to print the sum of digits of a number.
  8. Write a program to print the Armstrong numbers in a given range.
  9. Write a program to print the perfect numbers in a given range.
  10. Write a program to print the sum of the series 1 - 2 + 3 - 4 + ... + n.

Combination of Patterns/Series/OOP Concepts

  1. Write a program to print a pyramid pattern of prime numbers.
  2. Write a program to print a right-angled triangle pattern of Fibonacci numbers.
  3. Write a program to print the factorial of each number in a given range using recursion.
  4. Write a program to check if a given number is a palindrome using a method.
  5. Write a program to print a diamond pattern using the sum of digits of numbers.
  6. Write a program to print a pattern of Armstrong numbers.
  7. Write a program to print a combination of Pascal's triangle and prime numbers.
  8. Write a program to print the sum of the first n prime numbers using a method.
  9. Write a program to print the sum of the series 1 - 2 + 3 - 4 + ... + n using a method.
  10. Write a program to print the factorial of numbers in a pattern.

this Keyword

  1. Write a program to demonstrate the use of the this keyword in constructors.
  2. Write a program to demonstrate the use of the this keyword to refer to instance variables.
  3. Write a program to demonstrate the use of the this keyword to invoke current class methods.
  4. Write a program to demonstrate the use of the this keyword to return the current class instance.
  5. Write a program to demonstrate the use of the this keyword in method chaining.
  6. Write a program to demonstrate the use of the this keyword to invoke a constructor.
  7. Write a program to demonstrate the use of the this keyword to pass an argument in the constructor call.
  8. Write a program to demonstrate the use of the this keyword to resolve shadowing problem.
  9. Write a program to demonstrate the use of the this keyword in setter methods.
  10. Write a program to demonstrate the use of the this keyword to access class members.

super Keyword

  1. Write a program to demonstrate the use of the super keyword to access superclass variables.
  2. Write a program to demonstrate the use of the super keyword to invoke superclass methods.
  3. Write a program to demonstrate the use of the super keyword to invoke superclass constructors.
  4. Write a program to demonstrate the use of the super keyword to access superclass methods in a method overriding scenario.
  5. Write a program to demonstrate the use of the super keyword in constructor chaining.
  6. Write a program to demonstrate the use of the super keyword to call superclass static methods.
  7. Write a program to demonstrate the use of the super keyword in an inheritance hierarchy with multiple levels.
  8. Write a program to demonstrate the use of the super keyword to access superclass fields when they are shadowed by subclass fields.
  9. Write a program to demonstrate the use of the super keyword in the context of a superclass reference.
  10. Write a program to demonstrate the use of the super keyword in method overriding with return types.

final Keyword

  1. Write a program to demonstrate the use of the final keyword with variables.
  2. Write a program to demonstrate the use of the final keyword with methods.
  3. Write a program to demonstrate the use of the final keyword with classes.
  4. Write a program to demonstrate the use of the final keyword to create immutable objects.
  5. Write a program to demonstrate the use of the final keyword in method parameters.
  6. Write a program to demonstrate the use of the final keyword with static variables.
  7. Write a program to demonstrate the use of the final keyword with instance variables.
  8. Write a program to demonstrate the use of the final keyword in nested classes.
  9. Write a program to demonstrate the use of the final keyword in anonymous classes.
  10. Write a program to demonstrate the use of the final keyword with local variables in a method.

Methods

  1. Write a program to demonstrate method overloading.
  2. Write a program to demonstrate method overriding.
  3. Write a program to demonstrate the use of static methods.
  4. Write a program to demonstrate the use of instance methods.
  5. Write a program to demonstrate the use of recursive methods.
  6. Write a program to demonstrate the use of the main method.
  7. Write a program to demonstrate the use of the valueOf method in the String class.
  8. Write a program to demonstrate the use of the compareTo method in the String class.
  9. Write a program to demonstrate the use of the substring method in the String class.
  10. Write a program to demonstrate the use of the length method in the String class.

Miscellaneous

  1. Write a program to demonstrate the use of the Math class methods.
  2. Write a program to demonstrate the use of the Arrays class methods.
  3. Write a program to demonstrate the use of the StringBuilder class methods.
  4. Write a program to demonstrate the use of the StringBuffer class methods.
  5. Write a program to demonstrate the use of the Scanner class methods.
  6. Write a program to demonstrate the use of the Random class methods.
  7. Write a program to demonstrate the use of the System class methods.
  8. Write a program to demonstrate the use of the Locale class methods.
  9. Write a program to demonstrate the use of the Date class methods.
  10. Write a program to demonstrate the use of the Calendar class methods.

Advanced

  1. Write a program to demonstrate the use of nested loops.
  2. Write a program to demonstrate the use of the switch statement.
  3. Write a program to demonstrate the use of labeled break and continue.
  4. Write a program to demonstrate the use of exception handling using try, catch, finally.
  5. Write a program to demonstrate the use of custom exceptions.
  6. Write a program to demonstrate the use of assert statement.
  7. Write a program to demonstrate file reading and writing using FileReader and FileWriter.
  8. Write a program to demonstrate file reading and writing using BufferedReader and BufferedWriter.
  9. Write a program to demonstrate reading and writing binary data using FileInputStream and FileOutputStream.
  10. Write a program to demonstrate reading and writing objects using ObjectInputStream and ObjectOutputStream.

These questions cover a wide range of core Java concepts and provide practical exposure to various topics.

 

Share this article ...

💬WhatsApp📘Facebook💼LinkedIn🐦X

Trending Blogs...

Maven Tutorial

Maven Tutorial

Maven is a build automation tool primarily used for Java projects. It addresses two main aspects of building software: dependency management and project build lifecycle management.

Important DSA Topics for placements

Important DSA Topics for placements

Data Structures and Algorithms (DSA) are fundamental building blocks of computer science. A strong understanding of DSA is essential for every developer, regardless of their specialization.

Amazing Windows key shortcuts in Windows 11

Amazing Windows key shortcuts in Windows 11

Shortcuts are everyone’s favorite, be it in life or in Keyboard. We don’t know about life but we have some amazing shortcut tricks for your keyboard, which are newly introduced in windows 11. Let's have a look and understand these amazing shortcuts to reduce our finger pain

Share this article ...

💬WhatsApp📘Facebook💼LinkedIn🐦X