0% found this document useful (0 votes)
9 views2 pages

Java String and Object-Oriented Programs

The document lists various Java programming tasks, including string manipulation, object-oriented programming, and user interface development. It covers topics such as counting characters, checking for anagrams, creating classes and subclasses, handling exceptions, and developing web applications with servlets and JSP. Each task is aimed at enhancing Java programming skills through practical exercises.

Uploaded by

Pooja Agnihotri
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)
9 views2 pages

Java String and Object-Oriented Programs

The document lists various Java programming tasks, including string manipulation, object-oriented programming, and user interface development. It covers topics such as counting characters, checking for anagrams, creating classes and subclasses, handling exceptions, and developing web applications with servlets and JSP. Each task is aimed at enhancing Java programming skills through practical exercises.

Uploaded by

Pooja Agnihotri
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) Java Program to count the total number of

punctuation characters exists in a String


2) Java Program to count the total number of vowels
and consonants in a string
3) Java Program to determine whether two strings are
the anagram
4) Java Program to divide a string in ‘N’ equal parts.
5) Java Program to find all the permutations of a string
6) Java Program to replace the spaces of a string with a
specific character
7) Java Program to determine whether a given string is
palindrome
8) Java program to find the duplicate words in a string
9) Java Program to find the largest and smallest word in
a string
10) Reverse String in Java Word by Word
11) Write a Java program to create a class Vehicle with a
method called speedUp(). Create two subclasses Car and
Bicycle. Override the speedUp() method in each subclass to
increase the vehicle's speed differently.
12) Write a Java program to create a base class Shape with
methods draw() and calculateArea(). Create two subclasses
Circle and Cylinder. Override the draw() method in each
subclass to draw the respective shape. In addition, override the
calculateArea() method in the Cylinder subclass to calculate
and return the total surface area of the cylinder
13) Write a Java program that reads a list of integers from the
user and throws an exception if any numbers are duplicates.
14)Write a Java program to create a method that takes a string
as input and throws an exception if the string does not contain
vowels.
15) Write servlets that accepts user preferences (color,
hobby etc.) from user, saves it as cookie on user
machine and reads the cookie from the user machine.
16) Write an AWT application with checkbox such that
all cable TV channels will be displayed from the
selected category.
17) Create a simple Swing based applet that displays
two buttons. Each time a button is clicked, a message is
displayed that states which button was clicked.
18) Create JSP code that uses a persistant cookie (i.e. a
cookie with an expiration date in the future) to keep
track of how many times the client computer has
visited the page. Use set Max Age method to remain on
the client’s computer for one month. Display the
number of page hits (i.e. cookie’s value) every time the
page loads.
19) Write JSP program that asks user his favourite color
as request parameter and sets it as the background
color of the page or sets the background color white if
the parameter value is null.
20) Write a program in Java to show the mouse click
event. The program should change the background
colour of window randomly at each mouse click.

You might also like