0% found this document useful (0 votes)
2 views1 page

Java Programming Concepts Tutorial

Uploaded by

dungeonfx.432
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)
2 views1 page

Java Programming Concepts Tutorial

Uploaded by

dungeonfx.432
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

Tutorial 3

1.​ Write a Java program using methods and a switch-case statement to implement a simple
calculator that performs addition, subtraction, multiplication, and division. The program
should display a menu repeatedly until the user enters 0 to exit.

2.​ Write a Java program using functions to check whether a given string and a given number
entered by the user are palindromes

3.​ Write a Java program to demonstrate runtime polymorphism by creating a base class
Shape with an area() method, and subclasses Rectangle and Circle that override
the method, then call area() using base class references.

4.​ Write a Java program to demonstrate abstraction by creating an abstract class Animal
with an abstract method sound(), and a subclass Dog that implements this method.

You might also like