KTU Semester 3 Java Lab Cycle 1
Program Contents :-
- Print "Hello World"
- Add two numbers
- Check if given number is odd or even
- Check if given number is prime or nah
- Find sum of first 'n' natural numbers
- Find the factors of a given number
- Print The Fibonacci Series
- Find factorials of first 'n' numbers
- Check if given number is a Palindrome or not
- Check to see if a given number is an Armstrong number
KTU Semester 3 Java Lab Cycle 2
Program Contents :-
-
Write a Java class having overloaded methods to calculate area of rectangle and circle.
-
Define a class Queue for representing a queue data structure. The class must define a default constructor, a parameterized constructor and functions for enqueue, de-queue and display operations. Write a Java program to implement this.
-
Write a program to print the area and perimeter of a triangle having sides of 3, 4 and 5 units by creating a class named 'Triangle' without any parameter in its constructor.
-
Write a program to print the area of a rectangle by creating a class named 'Area' taking the values of its length and breadth as parameters of its constructor and having a method named 'returnArea' which returns the area of the rectangle. Length and breadth of rectangle are entered through keyboard.
-
Create a class with a method that prints "This is parent class" and its subclass with another method that prints "This is child class". Now, create an object for each of the class and call
1 - method of parent class by object of parent class 2 - method of child class by object of child class 3 - method of parent class by object of child class