TYBBA(CA)-Core Java Slips

Core Java Practical Slips – Complete Slip Wise Questions

This is the full collection of Java practical slip questions extracted and organized for easy revision and exam preparation.

Slip 1

A) Write a Java program to display characters from ‘A’ to ‘Z’.
B) Write a Java program to copy only non‑numeric data from one file to another file.

Slip 2

A) Write a Java program to display all the vowels from a given string.
B) Design a screen in Java to handle the Mouse Events such as MOUSE_MOVED and MOUSE_CLICK and display the position of the Mouse_Click in a TextField.

Slip 3

A) Write a Java program to check whether a given number is Armstrong or not (Use static keyword).
B) Define an abstract class Shape with abstract methods area() and volume(). Derive Shape into two classes Cone and Cylinder. Write a Java program to calculate area and volume of Cone and Cylinder (Use Super keyword).

Slip 4

A) Write a Java program to display alternate characters from a given string.
B) Write a Java program using Applet to implement a simple arithmetic calculator.

Slip 5

A) Write a Java program to display the following pattern:

5  
4 5
3 4 5
2 3 4 5
1 2 3 4 5

B) Write a Java program to accept list of file names through command line, delete files having extension .txt, and display name, location and size of remaining files.

Slip 6

A) Write a Java program to accept a number from user. If it is zero then throw user defined Exception “Number Is Zero”, otherwise calculate the sum of first and last digit of that number (Use static keyword).
B) Write a Java program to display transpose of a given matrix.

Slip 7

A) Write a Java program to display a Label with text “Dr. D Y Patil College”, background color red and font size 20 on the frame.
B) Write a Java program to accept details of ‘n’ cricket players (pid, pname, totalRuns, inningsPlayed, notOutTimes), calculate the average of all players, and display details of player having maximum average (Use array of objects).

Slip 8

A) Define an interface Shape with abstract method area(). Write a Java program to calculate area of Circle and Sphere (use final keyword).
B) Write a Java program to display all files having extension .txt from a given directory.

Slip 9

A) Write a Java program to display the following pattern:

1  
0 1
0 1 0
1 0 1 0

B) Write a Java program to validate a PAN number and Mobile number. If invalid, throw user defined Exception “Invalid Data”, otherwise display it.

Slip 10

A) Write a Java program to count the frequency of each character in a given string.
B) (Continue the Java program based on given requirements.)

Slip 11

A) Write a menu driven Java program using command line arguments for:

  1. Addition
  2. Subtraction
  3. Multiplication
  4. Division.
    B) Write an applet application to display a table lamp. The color of the lamp should change randomly.

Slip 12

A) Write a Java program to display each string in reverse order from a string array.
B) Write a Java program to display multiplication table of a given number into the list box by clicking a button.

Slip 13

A) Write a Java program to accept ‘n’ integers from the user, store them in an ArrayList and display the elements in reverse order.
B) Write a Java program that asks the user name and then greets the user by name in uppercase letters (e.g., “Hello, RAJ, nice to meet you!”).

Slip 14

A) Write a Java program to calculate power of a number using recursion.
B) Write a Java program to accept the details of an employee (Eno, EName, Sal) and display it on next frame using appropriate event.

Slip 15

A) Write a Java program to search a given name in an array and display its index or appropriate message if not found.
B) Write an applet application to display a smiley face.

Slip 16

A) Write a Java program to calculate sum of digits of a given number using recursion.
B) Write a Java program to accept n employee names from user, sort them in ascending order and display them (Use array of objects and static keyword).

Slip 17

A) Write a Java program to accept ‘n’ numbers through command line, store only Armstrong numbers into an array and display that array.
B) Define a class Product (pid, pname, price, qty). Write functions to accept product details, display them and calculate total amount (use array of objects).

Slip 18

A) Write a Java program to calculate area of Circle, Triangle & Rectangle (Use method overloading).
B) Write a Java program to copy the data from one file into another file, while copying change the case of characters in target file and replace all digits by ‘*’ symbol.

Slip 19

A) Write a Java program to display Fibonacci series using a function.
B) Create an Applet that displays the x and y position of cursor movement using Mouse and Keyboard (Use appropriate listener).

Slip 20

A) Write a Java program using AWT to create a frame with title “TYBBACA” and background color RED. If user clicks on close button then frame should close.
B) Construct a LinkedList containing names: CPP, Java, Python and PHP. Then extend your Java program to display the contents of the list using an Iterator and display the contents in reverse order using a ListIterator.

Slip 21

A) Write a Java program to display each word from a file in reverse order.
B) Create a Hashtable containing city name & STD code. Display the details of the Hashtable and search for a specific city to display its STD code.

Slip 22

A) Write a Java program to calculate factorial of a number using recursion.
B) Write a Java program to:

  1. Create a file.
  2. Rename a file.
  3. Delete a file.
  4. Display path of a file.

Slip 23

A) Write a Java program to check whether given file is hidden or not. If not then display its path, otherwise display appropriate message.
B) Write a Java program to design the specified frame using Swing.

Slip 24

A) Write a Java program to count number of digits, spaces and characters from a file.
B) Create a package with two classes: Student (Rno, SName, Per) with a method display() to display details of N students and Teacher (TID, TName, Subject) with a method display() to show teacher details teaching Java subject. (Make use of finalize() and array of objects.)

Slip 25

A) Write a Java program to check whether a given string is palindrome or not.
B) Create a package named Series having three classes to print series:
i) Fibonacci series
ii) Cube of numbers
iii) Square of numbers
Write a Java program to generate ‘n’ terms of the above series.

Slip 26

A) Write a Java program to display ASCII values of the characters from a file.
B) Write a Java program using applet to draw a temple.

Slip 27

A) Write a Java program to accept a number from user. If it is greater than 1000 then throw user defined exception “Number is out of Range”, otherwise display factors of that number (Use static keyword).
B) Write a Java program to accept directory name in text field and display list of files and subdirectories in List control from that directory by clicking a button.

Slip 28

A) Write a Java program to count the number of integers from a given list (Use command line arguments).
B) Write a Java program to accept details of 5 employees (Eno, Ename, Salary) and display them onto a JTable.

Slip 29

A) Write a Java program to check whether a given candidate is eligible for voting or not. Handle user defined as well as system defined exceptions.
B) Write a Java program using Applet for bouncing ball. Ball should change its color for each bounce.

Slip 30

A) Write a Java program to accept a number from user. If it is zero then throw user defined exception “Number is Zero”. If it is non‑numeric then generate error “Number is Invalid”, otherwise check whether it is palindrome or not.
B) Write a Java program to design the specified GUI (Use Swing).

Spread the love

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top