Advanced Computer Programming-QuestionPaper
Advanced Computer Programming-QuestionPaper
Advanced Computer Programming-QuestionPaper
Q#2 (18+7)
i. Suppose you are maintaining a list of users currently logged on to your Server.You
already have a list of registered users. As soon as a user tries to log in, you check his
email id and password from the existing list and then if valid, you add him to your list of
the users currently logged in. When a user logs off, you remove him from your current
list. Write a program that contains functions to
a) Add an object of class User to the current list
b) Search the User by his email ID
c) Remove a user from the list based on his emailId.
d) Inform about the total number of users currently logged in.
e) Display the data of all the users currently logged in.
The User class should have the instance variables of name, emailId, password and
country (all private). Use appropriate classes from Collection framework to maintain
the two lists. You will also save the email ID of the users into a file when a user logs
in for later use. (Your program doesn’t offer regisistration of new users and GUI is
not required) No need to write the import statements and getter/setters.
ii. Answer the following in short.
a) What is the purpose of Synchronized method in java?
b) Why do we need the wait() and notify() methods?
Q#3 (10)
You have done a Project in this course. Write down the code of one of the java classes
in your Project.
_______________________________ Page 1 of 1