Faculty of Computer Science
Placement Technical Skill Enhancement
Worksheet 4
Java Programming
• Static members, methods and block
Problem and source code to walkthrough
1. Java program to define a class named "Person" to count and display the number of instances created by
implementing static members and methods.
Attachment: [Link]
Problem to hands-on the students
1. Create a class named BankAccount with accountHolder and balance as its members. Display the balance
amount of all account holders. Also count and display the number of account holders implementing static
members and methods
Attachment: [Link]
Problem to be solved by the students
The student will learn to implement the concepts of static members, methods and block.
1. Create a class named Student with rollno, name, and array of marks as its members. Define the minimum
mark to get pass as a static member. Define methods to read the inputs and to display the grade of the
students. Also display the count of students get passed.
2. Let the students explore the implementation of static block in any real-time scenario. Assist the students to
identify the scenario and to implement.