0% found this document useful (0 votes)
3 views10 pages

Java 'Practice

Uploaded by

workformoney2000
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views10 pages

Java 'Practice

Uploaded by

workformoney2000
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

🔹 1.

Basic Syntax & Operators (5+)

 Print Hello World

 Take user input using Scanner

 Swap two numbers

 Calculate simple interest

 Use logical, relational, arithmetic operators

🔹 2. Conditional Statements (5+)

 Check even/odd

 Find largest of 3 numbers

 Grading system using if-else

 Simple calculator using switch

 Leap year check

🔹 3. Loops (for, while, do-while) (10+)

 Print numbers 1 to N

 Factorial of a number

 Fibonacci series

 Sum of digits

 Prime number check

 Print patterns: star, pyramid, inverted, etc.

 Reverse a number

 Palindrome number

 Armstrong number

🔹 4. Arrays (10+)

 Find max/min in array

 Sort array (bubble/insertion/selection)

 Reverse array
 Merge two arrays

 Remove duplicates

 Search element (linear & binary)

 Rotate array

 Frequency count

🔹 5. Strings (10+)

 Reverse a string

 Check palindrome

 Count vowels/consonants

 Remove spaces/special characters

 Frequency of characters

 Anagram check

 Title case conversion

 String compression

 Duplicate characters in string

🔹 6. Methods & Recursion (5+)

 Recursively find factorial

 Recursively find Fibonacci

 GCD and LCM using recursion

 Power function (x^n)

 Palindrome using recursion

🔹 7. OOPs Concepts (15+)

Understand + Practice with code examples

 Class & Object creation

 Constructor (default, parameterized, copy)

 Method Overloading
 Inheritance (Single, Multilevel, Hierarchical)

 Method Overriding

 this and super keyword

 Encapsulation (with getters/setters)

 Abstraction (using abstract class)

 Interface vs Abstract class

 Polymorphism (Compile-time and Run-time)

 final, static, instanceof usage

 Association, Aggregation, Composition

 Real-life OOP modeling (e.g., Car, Bank, Library)

 Access Modifiers (private, public, protected)

🔹 8. Exception Handling (6+)

 Try-catch block

 Multiple catch blocks

 Finally block

 Throw vs Throws

 Create custom exception

 Handle input mismatch & divide by zero

🔹 9. Collections Framework (15+)

 ArrayList: Add, remove, update, sort

 LinkedList: Add, remove, iterate

 HashSet: Add, remove, check duplicates

 TreeSet: Sorted elements

 HashMap: Put, get, key existence

 TreeMap: Sorted map

 LinkedHashMap: Maintain order

 Iterate using forEach, entrySet


 Count frequency of words using HashMap

 Find first non-repeating character using Map

 Remove duplicates using Set

 Stack implementation

 Queue (PriorityQueue, LinkedList)

 Sorting collections with custom comparator

 Store Student objects in List and sort by marks

🔹 10. File Handling ([Link]) (6+)

 Create & write to file

 Read file line by line

 Append to file

 Count lines, words, and characters

 Copy content from one file to another

 Store object data into file (serialization optional)

🔹 11. Multithreading (8+)

 Create thread by extending Thread class

 Create thread by implementing Runnable

 Thread lifecycle (start, run, sleep, join)

 Thread priorities

 Synchronized block/method

 Producer-Consumer problem (basic version)

 Deadlock simulation

 Timer using thread

🔹 12. Java 8 Features (Optional but useful) (5+)

 Lambda expressions

 Functional interfaces
 Stream API – filter, map, reduce

 Method references

 Default methods in interface

🔹 13. Mini Projects (5+)

 Library Management System (OOP + File)

 Student Report Card Generator (OOP)

 Bank Account Management (OOP + File)

 To-Do List CLI App (ArrayList + File)

 Quiz Application (with timer using Thread)

✅ Level 1: Basics (Q1–Q10)

Focus: Input/output, variables, data types, basic operators

⏳ Difficulty: Very Easy

1. Write a Java program to print "Hello, World!"

2. Take input from user and print it

3. Swap two numbers using a temporary variable

4. Find the sum, difference, product, and quotient of two numbers

5. Check whether a number is even or odd

6. Find the largest of three numbers

7. Convert Celsius to Fahrenheit

8. Find the square root of a number

9. Calculate simple interest

10. Find area and perimeter of a rectangle

✅ Level 2: Conditions & Loops (Q11–Q25)


Focus: if-else, switch, for/while/do-while loops

⏳ Difficulty: Easy

11. Check whether a number is positive, negative, or zero

12. Check whether a character is vowel or consonant

13. Print numbers from 1 to N using loop

14. Print multiplication table of a number

15. Print factorial of a number

16. Print Fibonacci series up to N terms

17. Check whether a number is prime

18. Reverse a number

19. Check palindrome number

20. Print all prime numbers between 1 to 100

21. Find the sum of digits of a number

22. Find LCM and HCF of two numbers

23. Create a simple calculator using switch

24. Print a pattern of stars (right-angled triangle)

25. Print a pyramid pattern of numbers

✅ Level 3: Arrays (Q26–Q40)

Focus: 1D Arrays, basic operations

⏳ Difficulty: Easy-Medium

26. Find the largest and smallest element in an array

27. Find the sum and average of array elements

28. Copy elements from one array to another

29. Reverse an array

30. Count frequency of each element in an array

31. Sort an array (Bubble sort)

32. Find duplicate elements in an array

33. Merge two arrays


34. Remove duplicate elements from array

35. Second largest element in array

36. Find pairs whose sum is equal to given number

37. Left and right rotate an array

38. Find max and min from array without sorting

39. Replace negative elements with 0

40. Check if an array is sorted

✅ Level 4: Strings (Q41–Q55)

Focus: String handling, character operations

⏳ Difficulty: Medium

41. Count vowels, consonants, digits and spaces in a string

42. Reverse a string

43. Check whether string is palindrome

44. Count frequency of each character in string

45. Remove all white spaces

46. Find duplicate characters

47. Sort a string alphabetically

48. Convert string to title case

49. Remove all vowels from string

50. Compare two strings (without using equals)

51. Replace a character with another

52. Count words in a string

53. Remove special characters from string

54. Check if two strings are anagrams

55. Find longest word in a sentence

✅ Level 5: Functions & Recursion (Q56–Q65)

Focus: Modular programming


⏳ Difficulty: Medium

56. Create a method to calculate factorial (recursion)

57. Write recursive function to find GCD

58. Write a function to check prime number

59. Create a function to reverse a string

60. Recursive Fibonacci

61. Check Armstrong number using function

62. Check perfect number

63. Convert binary to decimal and vice versa

64. Find sum of natural numbers using recursion

65. Implement power function (x^n)

✅ Level 6: Object-Oriented Programming (Q66–Q75)

Focus: Classes, Objects, Inheritance, Encapsulation

⏳ Difficulty: Medium

66. Create a class Student with name, roll, and marks

67. Add method to calculate grade of student

68. Create a class BankAccount with deposit/withdraw functions

69. Demonstrate constructor overloading

70. Create class hierarchy: Animal → Dog & Cat

71. Show method overriding and inheritance

72. Use getter and setter methods (encapsulation)

73. Create a static method and variable

74. Use final keyword with class and method

75. Use this and super keyword in constructor

✅ Level 7: ArrayList, Collections, and HashMap (Q76–Q85)

Focus: Java Collections Framework

⏳ Difficulty: Medium-Advanced
76. Store and display list of names using ArrayList

77. Sort ArrayList of integers

78. Remove duplicates using Set

79. Create a HashMap to store name and age

80. Count frequency of words using HashMap

81. Iterate over Map using entrySet

82. Convert Array to ArrayList

83. Check if a key exists in HashMap

84. Sort HashMap by keys

85. Find common elements between two lists

✅ Level 8: File Handling (Q86–Q90)

Focus: Read/write files

⏳ Difficulty: Advanced

86. Create and write to a file

87. Read contents of a file

88. Count number of words and lines in a file

89. Copy one file to another

90. Append data to a file

✅ Level 9: Exception Handling & Threads (Q91–Q95)

Focus: Errors, exceptions, multithreading

⏳ Difficulty: Advanced

91. Handle divide by zero exception

92. Create custom exception for age validation

93. Use try-catch-finally blocks

94. Create and run a basic thread

95. Create a thread using Runnable interface


✅ Level 10: Mini Projects (Q96–Q100)

Focus: Apply what you’ve learned

96. Student Report Card Generator (OOP, File handling)

97. Library Management System (OOP, ArrayList, Menu-based)

98. Bank Management System (OOP, File, Exception)

99. To-Do List CLI App (ArrayList, Menu, File)

100. Simple Quiz App (Input, Score system, Timer [Thread


optional])

Format Suggestion

 Save each file as Q01_HelloWorld.java, Q02_SwapNumbers.java, etc.

 Use GitHub to upload your completed work — looks good on resume


and helps track your progress!

You might also like