0% found this document useful (0 votes)
11 views4 pages

200 Java Program Questions

The document lists 200 Java programming questions categorized into six sections: Basic Programs, Conditional Statements, Loop Programs, Array Programs, String Programs, and OOP Programs. Each section contains a variety of tasks ranging from simple operations like printing text to more complex concepts like object-oriented programming. This comprehensive list serves as a resource for practicing and mastering Java programming skills.

Uploaded by

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

200 Java Program Questions

The document lists 200 Java programming questions categorized into six sections: Basic Programs, Conditional Statements, Loop Programs, Array Programs, String Programs, and OOP Programs. Each section contains a variety of tasks ranging from simple operations like printing text to more complex concepts like object-oriented programming. This comprehensive list serves as a resource for practicing and mastering Java programming skills.

Uploaded by

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

200 JAVA PROGRAM QUESTIONS

A. Basic Programs (1–30)


1. Print Hello World
2. Print your name
3. Add two numbers
4. Subtract two numbers
5. Multiply two numbers
6. Divide two numbers
7. Find remainder of two numbers
8. Swap two numbers (using third variable)
9. Swap two numbers (without third variable)
10. Check even or odd
11. Check positive or negative
12. Find largest of two numbers
13. Find largest of three numbers
14. Check leap year
15. Convert Celsius to Fahrenheit
16. Convert Fahrenheit to Celsius
17. Find square of a number
18. Find cube of a number
19. Calculate simple interest
20. Calculate compound interest
21. Find area of circle
22. Find area of rectangle
23. Find area of triangle
24. Find perimeter of circle
25. Find perimeter of rectangle
26. Print ASCII value of a character
27. Convert character to ASCII
28. Convert ASCII to character
29. Print first 10 natural numbers
30. Print first 10 whole numbers
B. Conditional Statements (31–60)
31. Check number is divisible by 5
32. Check number is divisible by 11
33. Check voting eligibility
34. Check alphabet or not
35. Check vowel or consonant
36. Check uppercase or lowercase
37. Check number is prime
38. Print grade using marks
39. Check year is century year
40. Check number is multiple of 3 and 7
41. Check character is digit
42. Check character is special symbol
43. Find roots of quadratic equation
44. Electricity bill calculation
45. Find profit or loss
46. Find largest among 4 numbers
47. Check triangle is valid
48. Check triangle type
49. Menu-driven calculator
50. Check pass or fail
51. Check employee bonus eligibility
52. Check number is palindrome
53. Check number is armstrong
54. Check number is perfect
55. Check number is spy number
56. Check number is harshad
57. Check number is automorphic
58. Check number is neon
59. Check number is buzz
60. Check number is duck
C. Loop Programs (61–100)
61. Print first n natural numbers
62. Print first n even numbers
63. Print first n odd numbers
64. Print sum of first n numbers
65. Print multiplication table
66. Reverse a number
67. Count digits of a number
68. Find sum of digits
69. Find product of digits
70. Check palindrome using loop
71. Check armstrong using loop
72. Generate Fibonacci series
73. Find factorial of number
74. Find power of number
75. Find LCM of two numbers
76. Find HCF of two numbers
77. Print prime numbers between 1 to n
78. Print first n prime numbers
79. Count prime numbers in range
80. Print factors of a number
81. Find sum of factors
82. Print perfect numbers in range
83. Print armstrong numbers in range
84. Print palindrome numbers in range
85. Print strong numbers
86. Print pattern of stars
87. Print inverted star pattern
88. Print pyramid pattern
89. Print number pattern
90. Print Floyd’s triangle
91. Print diamond pattern
92. Print hollow square
93. Print hollow pyramid
94. Print Pascal triangle
95. Print binary pattern
96. Print alternating 0 and 1
97. Print table from 1 to 10
98. Print numbers using do-while
99. Sum numbers using while loop
100. Factorial using do-while
D. Array Programs (101–140)
101. Declare and print array
102. Find sum of array elements
103. Find average of array
104. Find maximum in array
105. Find minimum in array
106. Find second largest
107. Find second smallest
108. Reverse an array
109. Copy array
110. Merge two arrays
111. Sort array ascending
112. Sort array descending
113. Linear search
114. Binary search
115. Count even and odd elements
116. Count positive and negative
117. Remove duplicate elements
118. Find frequency of elements
119. Rotate array left
120. Rotate array right
121. Find missing number
122. Find duplicate number
123. Check array palindrome
124. Find common elements
125. Find union of arrays
126. Find intersection of arrays
127. Difference of arrays
128. Replace element
129. Insert element
130. Delete element
131. Find pair with given sum
132. Largest pair sum
133. Split array
134. Check sorted array
135. Move zeros to end
136. Count distinct elements
137. Bubble sort
138. Selection sort
139. Insertion sort
140. Kth largest element
E. String Programs (141–180)
141. Print string
142. String length
143. Reverse string
144. Palindrome string
145. Count vowels and consonants
146. Count uppercase and lowercase
147. Count digits and spaces
148. Count words
149. Lowercase to uppercase
150. Uppercase to lowercase
151. Remove spaces
152. Remove vowels
153. Replace character
154. Check anagram
155. Character frequency
156. Duplicate characters
157. First non-repeated character
158. Sort characters
159. Compare strings
160. Concatenate strings
161. Check substring
162. Substring count
163. Split string
164. Capitalize first letter
165. Toggle case
166. Remove special characters
167. Longest word
168. Shortest word
169. Reverse words
170. Print characters
171. Count punctuation
172. Only digits check
173. Remove duplicate characters
174. String rotation
175. Permutations
176. Combinations
177. String to char array
178. Char array to string
179. StringBuilder example
180. StringBuffer example
F. OOP Programs (181–200)
181. Class and object
182. Constructor
183. Constructor overloading
184. Method overloading
185. Method overriding
186. Single inheritance
187. Multilevel inheritance
188. Hierarchical inheritance
189. super keyword
190. this keyword
191. Abstract class
192. Interface
193. Multiple inheritance
194. Encapsulation
195. Polymorphism
196. Exception handling
197. User defined exception
198. File read
199. File write
200. Menu driven program

You might also like