Loading...

Go Back

Next page
Go Back Course Outline

Java Full Course


Try Practical Questions

Java Practical Questions <>

Java Practical Questions (Intermediate – Advanced)

1. Reverse Words in a Sentence

Write a method that takes a sentence and reverses each word without changing their order.

Example: Java is funavaJ si nuf

2. Count Frequency of Each Character

Write a program that counts how many times each character appears in a string.

Example: banana → Output: {b=1, a=3, n=2}

3. Sort an Array Without Built-in Methods

Write your own method to sort an integer array in ascending order (e.g., using bubble sort).

4. Find All Duplicates in an Array

Given an integer array, return all duplicate elements.

Example: [1, 2, 3, 2, 4, 5, 1] → Output: [1, 2]

5. Check for Anagram Strings

Write a method to check whether two strings are anagrams (e.g., listen and silent).

6. Bank Account System (OOP)

Create a class BankAccount with:

  • Properties: accountNumber, balance
  • Methods: deposit(), withdraw(), getBalance()
  • Create multiple accounts and test transactions

7. Read and Write to a Text File

Write a program that:

  • Takes input from user using console
  • Writes it to a text file
  • Reads it back and prints to the console

8. Check Armstrong Number

An Armstrong number is one where the sum of its digits raised to the power of number of digits equals the number.

Example: 153 → Output: true (1³ + 5³ + 3³ = 153)

9. Employee Management System

Create an Employee class and an ArrayList<Employee> to store employees. Add methods to:

  • Add employee
  • Display all employees
  • Search by ID

10. Student Grading System

Write a program to:

  • Input student scores
  • Calculate average
  • Assign grade (A, B, C, D, F)
  • Display a full report using OOP
Go Back

Finish