LCWD LogoLearn Code With DurgeshLCWD
HomeCoursesHandbooksBlogsContact
About LCWDAbout Durgesh Tiwari
Flex Box Hero
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
  • FlexBox Game

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 durgeshkumar8896 • 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...

iphone 17 Launch 2025: Features, Price in India, Pros & Cons

iphone 17 Launch 2025: Features, Price in India, Pros & Cons

Apple has officially unveiled the **iPhone 17 series** on **September 9, 2025**, at its **“Awe Dropping” event**. The lineup includes **iPhone 17, iPhone 17 Air, iPhone 17 Pro, and iPhone 17 Pro Max**. With **120 Hz displays across all models, ultra-thin design, A19 chips, and camera upgrades**, Apple is raising the bar again.

Async/Await vs Promises in JavaScript: Which Should You Use?

Async/Await vs Promises in JavaScript: Which Should You Use?

Asynchronous programming is one of the most important topics in modern JavaScript development. Whether you’re building a web app, mobile application, or integrating APIs, you’ll often deal with operations that don’t finish instantly, such as fetching data or reading files.

AI: Boon or Curse? Advantages & Disadvantages Explained

AI: Boon or Curse? Advantages & Disadvantages Explained

Artificial Intelligence (AI) is no longer just a concept of the future—it is already shaping our present. From asking Alexa or Siri to play music, using Google Maps for directions, or experiencing personalized recommendations on Netflix, AI has become a part of our everyday life.

The Future of Technology: Quantum Computing and Its Ecosystem

The Future of Technology: Quantum Computing and Its Ecosystem

Quantum computing isn’t just another buzzword—it’s a completely new way of thinking about computers. Unlike our everyday laptops or phones that run on classical computing, quantum computers use the strange but powerful rules of quantum mechanics.

Tailwind CSS Cheat Sheet – Complete Utility Class Guide 2025

Tailwind CSS Cheat Sheet – Complete Utility Class Guide 2025

Tailwind CSS Cheat Sheet – Complete Utility Class Guide 2025

Expert-Level JavaScript Interview Q&A for 2025: Crack Advanced JS Interviews

Expert-Level JavaScript Interview Q&A for 2025: Crack Advanced JS Interviews

Get ready for tough coding interviews with this collection of advanced JavaScript interview questions and answers. Designed for experienced developers who want to master complex JS concepts and impress recruiters.

Share this article ...

💬WhatsApp📘Facebook💼LinkedIn🐦X