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

Java-QUESTION BANK

Java developer at the college's to SPOOF YOUR EMAIL to SPOOF YOUR EMAIL to SPOOF YOUR to be in the things I am a student in your mobile number sollu na po to the things that I have been working on a student of the sky hi there is a laptop that I have certificate for the sky is

Uploaded by

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

Java-QUESTION BANK

Java developer at the college's to SPOOF YOUR EMAIL to SPOOF YOUR EMAIL to SPOOF YOUR to be in the things I am a student in your mobile number sollu na po to the things that I have been working on a student of the sky hi there is a laptop that I have certificate for the sky is

Uploaded by

Thuppaki Shoot
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Hindusthan College of Engineering And Technology

Approved by AICTE, New Delhi, Accredited with ‘A’ Grade by NAAC


(An Autonomous Institution, Affiliated to Anna University, Chennai)
Coimbatore – 641 032
AUTONOMOUS SEMESTER UG DEGREE
BRANCH:
COURSE CODE AND NAME: 16IT4201 JAVA PROGRAMMING
Name of Course Coordinator : Mr. S.Karthic
Name of the course handling faculty members: 1. Mr.S.Karthic

Test Unit/Portions for INTERNAL EXAM - I


UNIT-I : OVERVIEW OF JAVA PROGRAMMING: Review of Object oriented programming-Introduction to
java programming-Features of Java Language, JVM -The Java Environment-Primitive Data types-variables-arrays-
control statements-classes and objects-access specifier-methods-constructor-finalize method-strings-Inheritance –
Internal Test 1 class hierarchy – polymorphism – dynamic binding – final keyword – abstract classes..
UNIT-II: PACKAGES AND INTERFACES
Packages-defining package-access protection-importing packages- interfaces-Defining an interface-implementing an
interface-applying interface-variables in interface-extended interface

PART A (2 Marks)
S.No Questions Marks COs
1. What are the features of java? 2 CO1
2. What is the use of ‘this’ keyword? 2 CO1
3. Differentiate final, finally, and finalize in java 2 CO1
4. Why java does not provide any destructor? 2 CO1
5. How is a constant defined in java? 2 CO1
6. What is Java Virtual Machine? 2 CO1
7. How to create one dimensional array in Java 2 CO1
8. What is a Constructor? How it differ from method in java. 2 CO1
9. What is a class? How memory is allocated dynamically to an object of a class? 2 CO1
10. What is an Object? Give example 2 CO1
11. List out the situations in which static methods are used. 2 CO1
12. What is inheritance? What are sub class and super class? 2 CO1
13. What are the different types of inheritance? 2 CO1
14. What is dynamic method dispatch? 2 CO1
Why Java does not provide multiple inheritance?How multiple inheritances can be 2 CO1
15. achieved in java?
16 Specify the use of super () in constructors. 2 CO1
Differentiate between early binding (or) static binding and late binding(or)dynamic 2 CO1
17
binding.
18 What is method overloading and method overriding? 2 CO1
19 What is an Abstract Class? 2 CO1
20 What is String Buffer class and how does it differs from String class?. 2 CO1
21 What is package and how is it used? 2 CO2

1
22 Define interface. Specify its uses. 2 CO2
23 Differentiate classe,abstract class and interface. 2 CO2
24 How will you extend one interface by other interface? 2 CO2
25 Which package is always imported by default? 2 CO2

PART B(14 Marks)


S.No Questions Marks COs
1. Explain the basic concepts of Object oriented programming? 14 CO1

a) Summarize the characteristics of java. 14 CO1


2.
b)Discuss the structure of a java program
What is inheritance? Classify the types of Inheritance and explain any three types of 14 CO1
3.
inheritance with suitable examples.
4. Explain arrays in java with an example. 14 CO1
5. Write in detail about the various branching and looping statements with suitable examples
Explain the concept of polymorphism. Show how compile-time and run-time 14 CO1
6.
polymorphism are achieved in java program with example.
7. Elaborate various types of constructor with relevant example 14 CO1
8. Describe Method overriding. Explain it with an example program 14 CO1
State the use of finalize() method in java. Show how garbage collection is achieved in 14 CO1
9.
java
How to declare and initialize string in java and also explain different string handling 14 CO1
10.
function with example?
With suitable explain how packages are created, imported and used. Elaborate on its 14 CO2
11.
package scope
What is an interface? What are the properties of Interfaces? Write java program to 14 CO2
12.
illustrate use of an interface.
13. How user defined Package is created in Java. Illustrate with relevant example 14 CO2

PART C( 10 Marks)
S.No Questions Marks COs
1. Write java program using classes to perform linear search on an array of N numbers 10 CO1
Write a java program to arrange the given characters in ascending order by getting the 10 CO1
2.
user input
Write a java program to find the area and volume of sphere using the concept of object, 10 CO1
3.
classes, methods and constructors.
Write a java program that implements the concept of method overloading to find the 10 CO1
4.
volume of cube and rectangular prism.
5. Write a java program to implement the concept of call by reference and call by value. 10 CO1
Write a java program that implements the concept of method overriding to find the area 10 CO1
6.
of rectangle and triangle.
Develop a java program to find the area of rectangle, square and circle using interfaces. 10 CO2
7.
Write a Package to perform arithmetic operation. Write a java program to import the 10 CO2
9.
package

2
Test Unit/Portions for INTERNAL EXAM – II
UNIT II - Exception Handling-exception types-uncaught exception-multiple catch-nested try-
throw and finally-built-in exceptions-multithreaded programming-java thread model-thread
priorities-synchronization thread class and runnable interface-creating multiple threads- inter
thread communication-string-input and output
Internal Test 2
UNIT III : INPUT AND OUTPUT STREAMS
I/O basics-reading console input-writing console output-reading and writing files-applet
fundamentals-Applet Basics-An Applet Skeleton-Simple Applet Display Methods-The HTML
APPLET Tag-Passing Parameters to Applets-using instance of-native method

PART A (2 Marks)
S.No Questions Marks COs
What are the different ways to handle exceptions? Is it essential to catch all types of 2 CO2
1.
exceptions?
2. What is the difference between throw and throws? 2 CO2
3. What is a thread? List out the thread states. 2 CO2
4. What is the importance of thread synchronization? 2 CO2
5. What is multithreading? 2 CO2
What are the two ways for creating a thread? Explain the difference in using runnable 2 CO2
6.
and extends in Thread.
7. How does java support inter thread communication? 2 CO2
8. Difference between sleep() and wait() 2 CO2
9. What is an Exception? Differentiate checked and unchecked exception? 2 CO2
10. Differentiate error from exception. How is custom exception created? 2 CO2
11. What is the use of Alive () and Join()method ? 2 CO2
12. How strings are implemented in java? 2 CO2
13. What are the constructors supported for String class? 2 CO2
14. List out some of the special string operations in java. 2 CO2
15. List out some of the character extraction operations in java. 2 CO2
16. List out the constructor supported for String Buffer class. 2 CO2
17. List out the methods of String Buffer class. 2 CO2
18. What is an applet? 2 CO3
19. What is the difference between applications and applets? 2 CO3
20. What is a stream and which class allows your to read objects directly from stream? 2 CO3
21. Difference between init() and start() methods. 2 CO3
22. How to set foreground and background color of the applet? 2 CO3
23. What are the methods that control an applet’s on-screen appearance 2 CO3
24. Explain how to read information from the applet parameters 2 CO3
25. What are the ways in which we can pass the parameter to an applet? 2 CO3
26. List the ways of reading the console input. 2 CO3
27. Write the structure of Applet. 2 CO3

3
28. What is a stream? Draw the hierarchy of stream class. 2 CO3
29. Distinguish between Input stream and reader classes & Output stream and writer classes. 2 CO3
30. Discuss the use of HTML tag in applets with an example 2 CO3
31. What are the attributes of APPLET tag? 2 CO3
32. How can we determine the height and width of the applet? 2 CO3
33. What are the different ways of running an applet? 2 CO3
34. Why the applet classes are declared as public? 2 CO3
35. How will you pass parameters to applet 2 CO3
36. What is Byte stream in Java? 2 CO3
37. What is the use of native methods in Applets? 2 CO3

PART B(14 Marks)


S.No Questions Marks COs
1. Explain multithreading, thread states and thread priority. 14 CO2
2. How threads are created in java? Explain the two implementation methods with 14 CO2
example javacycle
Explain life program
of thread with help of a diagram. How do the wait and Notify All/ 14 CO2
3.
Notify methods enable cooperation between threads?
4. What is thread synchronization? Discuss with an example Java program 14 CO2
5. Explain String Buffer class methods in java with an example program. 14 CO2
6. Discuss about the Java exception handling mechanisms with suitable examples. 14 CO2
Demonstrate the implementation of Inter-thread communication using a sample java 14 CO2
7.
program
8. Explain the types of I/O streams with suitable examples 14 CO3
9. Explain the Reader and Writer Stream class hierarchy with an example program 14 CO3
10. Explain about reading and writing file in java with a sample program. 14 CO3
11. Explain Object Serialization and Deserialization with a sample java program 14 CO3
12. What is an applet? Explain the applet classes and applet skeleton in detail. 14 CO3
Explain about Applet lifecycle with neat diagram. How applets are prepared and 14 CO3
13.
executed?

PART C(10 Marks)


S.No Questions Marks COs
Write java application program for generating four threads to perform following 10 CO2
operations:
• Getting N numbers as input
1.
• Printing even numbers
• Printing odd numbers
• Computing average
Write a program to find addition of two numbers given from the keyboard. Using 10 CO2
2.
exception handling, display appropriate message if the inputs are not valid numbers.
a) Explain the usage of nested try with an example.b) Write a program using throw 10 CO2
3. for catching an error that is not divisible by zero.

4
Write a thread synchronization implementation program that displays contents of 10 CO2
4.
text supplied through three threads
Design a program using Thread class and Runnable interfaces of your choice and 10 CO2
5.
compare the differences
Write an applet program that sets the foreground and back ground colours and 10 CO3
6.
outputs a string.
7. Write an example program that demonstrate passing parameters to Applets 10 CO3
8. Write an java program to demonstrate applet skeleton 10 CO3
9. Write an applet program to fill colours in Shapes. 10 CO3
10. Write a program to display image using applets. 10 CO3

Test Unit/Portions for MID SEMESTER EXAM


UNIT IV: EVENT HANDLING
Mid-Sem Test The Delegation Event Model-Event Classes-The Action Event Class-The Adjustment Event Class-The
Component Event Class-The Container Event Class

PART A (2 Marks)
S.No Questions Marks COs
1. What is an event delegation model? 2 CO4
2. What is the difference between event model and event delegation model? 2 CO4
3. What are the advantages of event driven programming? 2 CO4
4. Mention subclasses of the AWT event class 2 CO4
5. What is an event? What are the methods available to handle events in java? 2 CO4
6. What are the steps for handling events in java? 2 CO4
7. Distinguish between component and container. 2 CO4
PART B( 14 Marks)
S.No Questions Marks COs
1. Describe about event delegation model. 14 CO4
Explain about Action Event, Adjustment Event, component Event and Container 14 CO4
2.
Event classes and its corresponding interfaces.

PART C(10 Marks)


S.No Questions Marks COs

1. Design a scientific calculator using event-driven programming paradigm of Java. 10 CO4

Test Unit/Portions for INTERNAL EXAM - III


UNIT IV: Event Listener Interfaces-The Action Listener Interface-The Adjustment Listener
Interface-The Component Listener Interface-The Container Listener Interface- Using the
Delegation Event Model-adapter class-inner classes.
Internal Test 3 UNIT V: FRAMES AND WINDOWS: Window Fundamentals-Working with Frame
Windows-Creating a Frame Window in an Applet-Displaying Information Within a Window-
Working with Graphics-Drawing Lines-Drawing Rectangles-Drawing Ellipses and Circles-
Working with Color-Working with Fonts.

PART A (2 Marks)
S.No Questions Marks COs

5
1. Write the various types of Listener Classes? 2 CO4
Name Listener methods that must be implemented for Action Listener, 2 CO4
2.
Adjustment Listener, Component Listener and Container Listener
3. What is the difference between event-listener interface and event-adapter class? 2 CO4
4. What are inner class and anonymous class? 2 CO4
5. What interface is extended by AWT event listeners? 2 CO4
6. What is the need for inner classes? Explain with an example 2 CO4
"Java class can be used both as an applet as well as an application" - Support this 2 CO4
7.
statement with an example.
8. With an example explain an adapter class 2 CO4
9. What is the purpose of repaint method? When should we use repaint method? 2 CO4
10. How does a radio button differ from the check box in java? 2 CO4
11. Draw the inheritance hierarchy for frame and component classes in AWT 2 CO5
12. What is the difference between the ‘Font’ and ‘Font Metric’ Class 2 CO5
13. Define AWT? 2 CO5
14. What is Panel? 2 CO5
15. What is a frame? 2 CO5
16. List the method of graphics class 2 CO5
17. Is there any method for drawing circle in graphics class? If not explain 2 CO5
18. Write syntax for drawing a line. 2 CO5
19. Give any methods used for drawing lines. 2 CO5
20. Summarize the fundamentals of windows 2 CO5
21. List out the method of color class 2 CO5
22. What are way to create a frame in AWT component 2 CO5
23. Which method is used to enable or disable the Frame? 2 CO5
24. Write syntax for Rounded Rectangle 2 CO5
25. Differentiate between frame and panel 2 CO5
26. What is the difference between a Window and a Frame? 2 CO5
PART B(14 Marks)
S.No Questions Marks COs
1. Explain the types of inner classes with suitable examples 14 CO4
2. Create an anonymous inner class for handling Action event into an applet. 14 CO4
What is event handling in java? List out available event classes and listener 14 CO4
3.
interfaces and explain with examples.
4. Explain adapter class with suitable example 14 CO4
5. Demonstrate the mouse and Keyboard event handlers with a java program 14 CO4
6. Explain detail about the following terms a) Component b) Container c) Panel d) 14 CO5
7. Window
Enumeratee) the
Frame f )ofCanvas
steps displaying information within a window with examples 14 CO5
8. Explain in detail about color class with relevant example java program 14 CO5

9. Illustrate about creating a frame window in an applet with a sample java program. 14 CO5

10. Explain in detail about font class with relevant example java program 14 CO5

6
11. Describe about working with graphics in detail. 14 CO5

PART C(10 Marks)


S.No Questions Marks COs
1. Write a java program that implements Action Listener Interface. 10 CO4
2. Develop a java program that implements Adjustment Listener Interface. 10 CO4

3. Illustrate with a java program that implements Component Listener Interface. 10 CO4
4. Design a java program that implements Container Listener Interface. 10 CO4
5. Write a java program to draw lines and rectangles with coordinates of your choice. 10 CO5
6. Write a java program to draw ellipses and circles with coordinates of your choice. 10 CO5
7. Create a java program for color demonstration applet 10 CO5
8. Develop a java program to show fonts 10 CO5

SIGNATURES :
Name of the course coordinator S.Karthic

Name of the course handling faculty S.Karthic

HOD DEAN ADVISOR/COE

You might also like