0% found this document useful (0 votes)
9 views

JAVA Lab Session Plan 2

1. The document is a session plan for a course on Programming in Java for User Interfaces. 2. The session plan covers topics like constructors and methods with inheritance, abstract classes and interfaces, final, static, this and super keywords, generics in Java, Java utilities, and includes example programs and timings for each topic. 3. Some example programs include overriding methods from a parent class, overriding a constructor, implementing abstract methods, using interfaces, and examples of static, final and this keywords.

Uploaded by

Pravin Raj
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

JAVA Lab Session Plan 2

1. The document is a session plan for a course on Programming in Java for User Interfaces. 2. The session plan covers topics like constructors and methods with inheritance, abstract classes and interfaces, final, static, this and super keywords, generics in Java, Java utilities, and includes example programs and timings for each topic. 3. Some example programs include overriding methods from a parent class, overriding a constructor, implementing abstract methods, using interfaces, and examples of static, final and this keywords.

Uploaded by

Pravin Raj
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Saveetha School of Engineering

Saveetha Institute of Medical and Technical Sciences, Chennai


Computer Science and Engineering

Subject Code / Name: CSA0929 / Programming in Java for User Interfaces


Course Faculty Name: Dr.R.Jeena
SESSION PLAN No.2 – Java features and concepts

Date Session No Topic Programs Timings


1. Write java code for creating 3 methods called even, odd and
prime in parent class and override them from child class. The
parent class should print 1 to 20 range in all method, but child
print 1 to 30 array range in all methods. And access all the
methods using derived class object
2. Override a default constructor, which contains a=10,b=15 in java
Constructors and using parametrized constructor which contains a=20,b=25. Create
methods with a method called disp(). And call both the constructors associating
inheritance it with disp()
1
(Single and 3. Java program to create a Base class with a method called ‘void
Multilevel area(int a, int b)’ which print area of a square. Now override the 8.00 AM to 9.00 AM
Inheritance) method from Derived class and make it print area of a rectangle.
14-03-2024 4. Write java code to overload a method called ‘int sum(int a, int b)’
by the 3 ways.
a) By increasing and decreasing no. of parameters
b) By changing the data types of parameters
c) By interchanging the parameters

5. Create an abstract class with 2 abstract methods(total() and


average()) and 3 concrete methods(mean(), mode(), median()).
Abstract classes Now extend the abstract class from a concrete class and use all the
and Interfaces methods in that abstract class
2 9.00 AM to 10.00 AM
(Multiple 6. Create an interface with 4 methods called add(), sub(), mul() and
Inheritance) div(). Then give implementation for all in the implementing class.
7. Create 3 interfaces with 1 method each sum(), avg(), percentage()
respectively. Now implement all the 3 interfaces in your class
8. Create an interface called Tree and extend 2 classes from it called
Branch1 and Branch2. Tree should contain methods fruits(),
leaves() and flowers(), these methods contain 2,3,4 parameters
respectively.

9. Use static keyword in the following levels


a) Static variable
b) Static method
c) Static block
d) Static nested classes
10. Use Final keyword in the following levels
a) Final variable
b) Final method
Final, Static, this c) Final classes
3 and super 11. Use ‘this’ keyword in the following purposes 10.00 AM to 11.00 AM
keywords a) Referencing instance variable
b) Invoking another constructor
c) Passing current object as a parameter
d) Returning current object

12. Use ‘super’ keyword in the following purposes


a) Accessing superclass members
b) Calling superclass constructor
c) Invoking superclass methods

13. Single type parameter generic class


4 Generics in Java 14. Multiple type parameter generic class 12.00 PM to 01.00 PM
15. Using generics on methods example
16. Restrict use of primitive types using generics

5 Java utilities 17. Use Scanner to get Char, String, Int, Float and Double input at 01.00 PM to 02.00 PM
same moment.
18. Find System Date and Time using Date class
19. Use UUID to generate a random Universally Unique Identifier
20. Java toString() and equals() method.

6 CLASS TEST 2 02.00 PM to 03.00 PM

Course Coordinator HOD

You might also like