
• no-arg constructor that initializes startTime with the current time.
• A method named start() that resets the startTime to the current time.
• A method named stop() that sets the endTime to the current time.
• A method named getElapsedTime() that returns the elapsed time for
the stopwatch in milliseconds.
• Declare object of StopWatch to demonstrate stop watch.
Hint: Use System.currentTimeMillis() to get current time in milliseconds.
Create a class called Employee that includes:
I. Three instance variables— id (type String), name (type String) and
monthly_salary (double).
II. A default constructor that initializes the three instance variables.
III. A setter and a getter method for each instance variable (for example
for id variable void setId(String id), String getId( )).
IV. displayEmployee() method for displaying employee details.
Write a driver class named EmployeeTest that demonstrates class Employee’s
capabilities. Create two Employee objects and display each object’s yearly
salary. Then give each Employee a 10% raise and display each Employee’s
yearly salary again.
Differentiate between checked and unchecked exception?
Exemplify throw and throws clause of exception handling?
Demonstrate use of try catch block by catching ArithmeticExceptions and
InputMismatchExceptions?
Describe thread life cycle with block diagram?
Differentiate between Thread class and Runnable interface for implementing
Threads?
Write a program to make calculator that accepts input from commandline?
Use java’s exception handling mechanism to handle abnormal situation?
Define Queue interface of java collection classes?
Explain types of polymorphism?
What are the differences between ArrayList and LinkedList? Demonstrates
use of ArrayList with example?
Define Object Serialization?
What are the differences between text I/O and binary I/O?
Describe and demonstrate Binary I/O classes of java?
Answer in one line:
(i) Write the name of package in which all collection classes and interface are
grouped.
(ii) Write the name of collection interface or abstract class which store and
process object in a first-in, first-out fashion.
(iii) Write the name of method that checks whether the collection contains the
specified element.
What do you understand by event source and event object? Explain how to
register an event handler object and how to implement a handler interface?
Enlist various Layout panes available in JavaFX?
Illustrate basic structure of JavaFX program?