Java Programming Objective Question
List
EASY QUESTIONS
1. Print Message
Write a program to print “Thank you for your order.”
2. Sum of Ten
Accept a starting number, calculate and print the sum of ten consecutive numbers.
3. Ludo King
Accept points for three players, validate their scores, and indicate the winner or a tie.
4. Sim Card
Input a mobile phone number and compare the sum of its even and odd digits.
5. Reverse and Expand
Reverse a 4-digit number and display its expanded form (e.g., 4321 ⇒ 4000 + 300 +
20 + 1).
6. Game Card Points
Take card details and allow withdrawal of points after validation.
7. College Admission
Input and print details for a college applicant, including cutoff and personal info.
8. Stock List
Input company names into a list and print them.
9. Electricity Board
Input customer info and electricity units, then compute and print bill amount.
10. Find the Winner
Input several teams with timed entries, find which team finishes fastest.
11. PIN Number
Input PIN numbers, validate using given digit rules, and print valid PINs.
12. Resort Booking
Parse name:adults:children:days, validate, and print booking with final cost.
13. Babitha’s App
Split a paragraph into words, count each word’s frequency, print sorted count.
MEDIUM QUESTIONS
14. Oxygen Plants
Calculate how many oxygen plants fit in a room and the total oxygen produced.
15. Doctor Details
Create Doctor and Hospital classes, accept details, and print them.
16. Movie Ticket – Static
Simulate movie ticket booking with available tickets as a static variable.
17. Incredible Toys
Input details for customer and toy; validate customer ID format and apply toy-type
discount.
18. Two Arrays Game
Create two same-sized arrays, generate a third array (even indices sums, odd indices
differences).
19. Fishing Competition
Input name, age, fish counts, compute score by fish type and age.
20. Array Manipulation (Multi-catch Exception)
Input an array, replicate element at a position; handle errors.
21. Plip Event (Student Score Filter)
Map student names to scores, count how many score above 90.
22. Travel Agency (Commission)
Input ticket details; use an interface and lambda for commission calculation by class
type.
23. Happy Mart (Product Sorting)
Input Product objects, sort and print by ID or price.
24. Subset or Not (HashSet)
Check if one array is a subset of another.
25. Lottery Winner
Analyze a ticket, count unlucky digit occurrences; judge as lucky/unlucky.
26. Prime Number Game
Array ops: sum corresponding elements, check prime status of last digit.
27. Departmental Store – Interface
Use interfaces for bonus points and delivery charges calculation.
28. Water Distributor
Calculate and print discounted bill for container orders, using an interface and
lambda.
29. College Account (TuitionFee Interface)
Lambda for computing tuition fee per student and course type.
HARD QUESTIONS
30. Disney Tourism (Abstract/Inherit)
Create abstract Booking class, extend for BoatHouseBooking/BoatRideBooking with
overridden cost logic.
31. Vivek Furnitures – Polymorphism
Abstract base (Bero), Steel/Wooden subclasses, type-based discount.
32. College Fee – Abstract Class
Abstract Student class, DayScholar and Hosteller subclasses with different fee logic.
33. Endowment Plan – Inheritance
Abstract Endowment base with Educational/Health subtypes, each with custom logic.
34. Auditing (Interface, Lambda, Map)
EmployeeAudit interface, lambda to filter employees by salary in a map.
35. Number Category (Lambda, Amicable/Palindrome)
Lambda interface to check if two numbers are amicable and whether their product is
a palindrome.
36. Vehicle Capacity Calculator (Custom Exception)
PetrolOverflowException: validate petrol capacity.
37. Telecom Regulatory Authority (Custom Exception)
MaximumDataUsageException: validate data usage.
38. Campus Radio Frequency (Custom Exception)
StationNotAvailableException: validate scanned frequency, throw/handle as needed.
39. String Extraction (Exception Handling)
Extract substring; handle StringIndexOutOfBoundsException.
40. Top Tier Motors (Vehicle Discount, Map, Repeated Search)
Add vehicle info to map, apply company-based discount.
41. Complete the Caption (String Mapping)
Given two strings, fill “!” positions in the first with characters from the second.
42. Student Details Constructor Overloading
Design student class with multiple constructors.
43. Product Sort/Filter (Advanced Mapping)
Objects, sorting via comparators, print sorted output by multiple fields.