0% found this document useful (0 votes)
3 views57 pages

3 Java

Uploaded by

Shravani Shravz
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views57 pages

3 Java

Uploaded by

Shravani Shravz
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Guru Nanak Institutions Technical Campus

(Autonomous)
School of Engineering and Technology
Ibrahimpatnam, R R District, Telangana – 501506

COURSE FILE

OBJECT ORIENTED PROGRAMMING THROUGH JAVA


(22PC0AD02)
[Link]. [II/ I]
Academic Year: 2026-2027

[Link]
[Link]

DEPARTMENT OF ARTIFICIAL INTELLIGENCE AND DATA SCIENCE

SCHOOL OF ENGINEERING AND TECHNLOGY

1
GURU NANAK INSTITUTIONS OF TECHNICAL CAMPUS
(Autonomous)
[Link] (CSE-AI&DS) II Year I – Sem L T P C
3 0 0 3

( 22PC0AD02 ) OBJECT ORIENTED PROGRAMMING THROUGH JAVA

SYLLABUS

UNIT – I
OOP concepts: Classes and objects, data abstraction, encapsulation, inheritance, benefits of
inheritance, polymorphism, procedural and object oriented programming paradigm; Java
programming: History of java, comments data types, variables, constants, scope and life time
of variables, operators, operator hierarchy, expressions, type conversion and casting,
enumerated types, control flow statements, jump statements, simple java stand alone
programs, arrays, console input and output, formatting output, constructors, methods,
parameter passing, static fields and methods, access control, this reference, overloading
methods and constructors, recursion, garbage collection, exploring string class.

UNIT – II
Inheritance: Inheritance hierarchies, super and subclasses, member access rules, super
keyword, preventing inheritance: final classes and methods, the object class and its methods;
Polymorphism: Dynamic binding, method overriding, abstract classes and methods;
Interface: Interfaces vs Abstract classes, defining an interface, implement interfaces,
accessing implementations through interface references, extending interface; Packages:
Defining, creating and accessing a package, understanding CLASSPATH, importing
packages.

UNIT – III
Exception Handling: Benefits of exception handling, the classification of exceptions,
exception hierarchy, checked and unchecked exceptions, usage of try, catch, throw, throws
and finally, re-throwing exceptions, exception specification, built in exceptions, creating own
exception sub classes. Multithreading: Differences between multiple processes and multiple
threads, thread states, creating threads, interrupting threads, thread priorities, synchronizing
threads, inter thread communication.

UNIT – IV
Event handling and Event resources Streams, byte streams, character stream, text
input/output, binary input/output, random access file operations, file management using file
class; Connecting to Database: Connecting.

UNIT – V
GUI programming with Java: The AWT class hierarchy, introduction to swing, swing Vs
AWT, hierarchy for swing components, containers, JFrame, JApplet, JDialog, JPanel;
Overview of some swing components: JButton, JLabel, JTextField, JTextArea, simple
applications; Layout management: Layout manager types: Border, grid and flow; Applets:
Inheritance hierarchy for applets, differences between applets and applications, life cycle of
an applet, passing parameters to applets.

2
TEXT BOOKS:
1. Herbert Schildt, Dale Skrien, “Java Fundamentals: A Comprehensive Introduction”,
McGraw Hill, 1st Edition, 2013.
2. Herbert Schildt, “Java the Complete Reference”, McGraw Hill, Osborne, 8th Edition,
2011.
3. T. Budd, “Understanding Object Oriented Programming with Java”, Pearson Education,
Updated Edition (New Java 2 Coverage), 1999.

REFERENCE BOOKS:
1. P.J. Deitel, H. M. Deitel, “Java: How to Program”, Prentice Hall, 6th Edition, 2005.
2. P. Radha Krishna, “Object Oriented Programming through Java”, Universities Press, CRC
Press, 2007.
3. Bruce Eckel, “Thinking in Java”, Prentice Hall, 4th Edition, 2006.
4. Sachin Malhotra, Saurabh Chaudhary, “Programming in Java”, Oxford University Press,
2nd Edition, 2014.

3
Vision of Institution - GNITC

To be an internationally renowned institution in Engineering, Management, Pharmacy and


related fields to produce scientists, engineers, entrepreneurs, leaders, academicians and
thinkers of tomorrow with exemplary professional conduct and adherence to ethical values to
serve for changing needs of industry and society.

Mission of Institution- GNITC

M1: Imbibe soft skills, technical skills, creatively and passion in students.
M2: Develop the faculty to reach the International standards.
M3: Maintain outcome based student centric teaching learning with high academic standards
and quality that promotes the analytical thinking and independent judgement.
M4: Promote research, innovation, product development by collaborating with reputed
industries & reputed universities in India and abroad. Offer collaborative industry
programs in emerging areasand instill the spirit of enterprising.
M5: To instill the ethical values in the faculty and students to serve the society.

Department of Computer Science and Engineering

Vision, Mission & Quality Policy

Vision

 To be a premier department of Computer Science and Engineering in the region


Mission

1. Nurture young individuals into knowledgeable, skillful and ethical professionals in their
pursuit of Computer Science and Engineering.
2. Nurture the faculty to expose them to world-class infrastructure.
3. Sustain high performance by excellence in teaching, research and innovations.
4. Extensive partnerships and collaborations with foreign universities for technology up
gradation.
5. Develop Industry-Interaction for innovation and product development.
QUALITY POLICY

GNITC is committed to provide quality education through dedicated and talented faculty,
world class infrastructure, labs and updated research center to the students.

Programme Educational Objectives of CSE Department

PEO-1: Graduates shall have the ability to apply knowledge across the disciplines and in
emerging areas of Computer Science and Engineering for higher studies, research,
employability, product development and handle the realistic problems

4
PEO-2: Graduates shall have good communication skills, possess ethical conduct, sense of
responsibility to serve the society and protect the environment.

PEO-3: Graduates shall possess academic excellence with innovative insight, soft skills,
managerial skills, leadership qualities, Knowledge of contemporary issues and understand the
need for lifelong learning for a successful professional career.

.Department of Computer Science & Engineering

Programme Outcomes (POs)

1. Engineering knowledge: Apply the knowledge of mathematics, science,


engineering fundamentals, and an engineering specialization to the solution of
complex engineering problems.
2. Problem analysis: Identify, formulate, review research literature, and analyze
complex engineering problems reaching substantiated conclusions using first
principles of mathematics, natural sciences, and engineering sciences.
3. Design/development of solutions: Design solutions for complex engineering
problems and design system components or processes that meet the specified needs
with appropriate consideration for the public health and safety, and the cultural,
societal, and environmental considerations.
4. Conduct investigations of complex problems: Use research-based knowledge and
research methods including design of experiments, analysis and interpretation of data,
and synthesis of the information to provide valid conclusions.
5. Modern tool usage: Create, select, and apply appropriate techniques, resources, and
modern engineering and IT tools including prediction and modeling to complex
engineering activities with an understanding of the limitations.
6. The engineer and society: Apply reasoning informed by the contextual knowledge to
assess societal, health, safety, legal and cultural issues and the consequent
responsibilities relevant to the professional engineering practice.
7. Environment and sustainability: Understand the impact of the professional
engineering solutions in societal and environmental contexts, and demonstrate the
knowledge of, and need for sustainable development.
8. Ethics: Apply ethical principles and commit to professional ethics and responsibilities
and norms of the engineering practice.
9. Individual and team work: Function effectively as an individual, and as a member
or leader in diverse teams, and in multidisciplinary settings.
10. Communication: Communicate effectively on complex engineering activities with
the engineering community and with society at large, such as, being able to
comprehend and write effective reports and design documentation, make effective
presentations, and give and receive clear instructions.
11. Project management and finance: Demonstrate knowledge and understanding of the
engineering and management principles and apply these to one’s own work, as a
member and leader in a team, to manage projects and in multidisciplinary
environments.

5
12. Life-long learning: Recognize the need for, and have the preparation and ability to
engage in independent and life-long learning in the broadest context of technological
change.

Programme Specific Outcomes (PSOs)

PSO 1: Ability to apply software engineering skills to design, develop and debug optimized
solutions for all real world problems.
PSO 2: Ascertain knowledge in diverse areas of Computer Science and experience an
environment conducive in novel skills for successful career, entrepreneurship and higher
studies.

Mapping of PEO’s and POs/PSOs

PO1 PO PO PO PO PO PO PO PO PO PO PO PS PS
PEO 1 √ √ √ √ √ √ √ √ √
PEO-2 √ √ √ √ √ √ √
PEO-3 √ √ √ √ √ √ √

6
CONSOLIDATED TEACHING PLAN

Subject (22PC0AD02) Object Oriented Programming Through Java

Faculty Mr .[Link]
Text Books (to be acquired by the Students)
Herbert Schildt, Dale Skrien, “Java Fundamentals: A Comprehensive
Book 1
Introduction”, McGraw Hill, 1st Edition, 2013.
Herbert Schildt, “Java the Complete Reference”, McGraw Hill, Osborne, 8th
Book 2
Edition, 2011.
Reference Books
Book 3 .J. Deitel, H. M. Deitel, “Java: How to Program”, Prentice Hall, 6th Edition, 2005.
Chapters
Unit Topic Book 3 No of Classes
Book 1 Book 2

Object oriented Chap-1, Chap 1


I Chap-1,2 15
Programming Concepts 2,3,4,5,6,7

Chap 2,3
II Inheritance Chap-8,9 Chap 3,4 12

Exception handling,
III Multithreading Chap-10,12 Chap 4,5 10
Chap 4,5

Chap 6,7
IV Event Handling Chap-11 Chap 7,8 9

Applets GUI Chap Chap 8,9


V Chap-17,18 9
programming with Java 9,10

7
Total Classes 55
Tutorial Classes 16
Classes for Beyond Syllabus-03, Remedial Classes-04, Descriptive
09
Tests-02
Total Number of Classes 80

COURSE INFORMATION SHEET

PROGRAMME: Computer Science & DEGREE: B. Tech.


Engineering
COURSE: Object Oriented Programming SEMESTER: 2- 1 Sem
Through Java CREDITS: 3
COURSE CODE: 22PC0AD02 COURSE TYPE: CORE
REGULATION: R25
COURSE AREA/DOMAIN: Programming CONTACT HOURS: 3 hours/Week.
Language
CORRESPONDING LAB COURSE CODE LAB COURSE NAME: - Java Programming
(IF ANY): - 22PC0AD05 Lab

SYLLABUS:
UNIT DETAILS HOURS
I OOP concepts: Classes and objects, data abstraction, encapsulation,
inheritance, benefits of inheritance, polymorphism, procedural and object
oriented programming paradigm; Java programming: History of java,
comments data types, variables, constants, scope and life time of variables,
operators, operator hierarchy, expressions, type conversion and casting,
15
enumerated types, control flow statements, jump statements, simple java stand
alone programs, arrays, console input and output, formatting output,
constructors, methods, parameter passing, static fields and methods, access
control, this reference, overloading methods and constructors, recursion,
garbage collection, exploring string class.

8
II Inheritance: Inheritance hierarchies, super and subclasses, member access
rules, super keyword, preventing inheritance: final classes and methods, the
object class and its methods; Polymorphism: Dynamic binding, method
overriding, abstract classes and methods; Interface: Interfaces vs Abstract 12
classes, defining an interface, implement interfaces, accessing implementations
through interface references, extending interface; Packages: Defining, creating
and accessing a package, understanding CLASSPATH, importing packages.
III Exception Handling: Benefits of exception handling, the classification of
exceptions, exception hierarchy, checked and unchecked exceptions, usage of
try, catch, throw, throws and finally, re-throwing exceptions, exception
specification, built in exceptions, creating own exception sub classes. 10
Multithreading: Differences between multiple processes and multiple threads,
thread states, creating threads, interrupting threads, thread priorities,
synchronizing threads, inter thread communication.
IV Event handling and Event resources Streams, byte streams, character stream,
text input/output, binary input/output, random access file operations, file 09
management using file class; Connecting to Database: Connecting.
V GUI programming with Java: The AWT class hierarchy, introduction to
swing, swing Vs AWT, hierarchy for swing components, containers, JFrame,
JApplet, JDialog, JPanel; Overview of some swing components: JButton,
JLabel, JTextField, JTextArea, simple applications; Layout management: 09
Layout manager types: Border, grid and flow; Applets: Inheritance hierarchy
for applets, differences between applets and applications, life cycle of an
applet, passing parameters to applets.
TOTAL HOURS 55
Tutorial classes 16
Descriptive Tests 02
Classes for beyond syllabus 03
Remedial Classes/NPTEL 04
Total Number of Classes 80

TEXT/REFERENCE BOOKS:

T/R BOOK TITLE/AUTHORS/PUBLICATION


T Java; the complete reference, 7th edition, Herbert schildt, TMH
T Understanding OOP with Java, updated edition, T. Budd, Pearson education
R An Introduction to programming and OO design using Java, [Link] and F.A. Hosch,
John Wiley & sons.
R Introduction to Java programming, Y. Daniel Liang, Pearson Education
R An introduction to Java programming and object oriented application development,
R.A. Johnson- Thomson

9
COURSE PRE-REQUISITES:

[Link] COURSE NAME DESCRIPTION SEM


18PC0CS01 Programming for Problem Students should have I Year
solving understanding of programming Sem-I
and analyzing algorithms and
implementation
18PC0CS03 Data Structures Students should have II Year
understanding of Data structures Sem-I
and analyzing algorithms and
implementation

COURSE OBJECTIVES

The aim of the course is to solve problems using algorithm design methods such as Divide
and conquer, Backtracking, Dynamic Programming, Greedy method and Branch and Bound.

10
COURSE OUTCOMES: By the end of the course, students will be able to

[Link] DESCRIPTION PO
MAPPING
CO1 CO 1: Describe the concepts of OOP and basics of java programming 1
CO2 CO 2: Express the programming skills in problem solving 2
CO3 CO3: Solve the exceptions and handle the exceptions in programming 3
CO4 CO 4: Extend the knowledge to working with files and Connecting to 5
the Database
CO5 CO 5: Extend their knowledge to GUI applications 4

Mapping of COs versus POs and PSOs:

Program Outcomes PSOs


P
Course Outcomes P P P P P P PO P PO PO PO PSO PSO
O
O1 O2 O3 O4 O6 O7 8 O9 10 11 12 1 2
5
CO 1: Describe the concepts 3 2 1 0 0 0 0 0 0 0 0 0 0 0
of OOP and basics of java
programming
CO 2: Express the 2 3 1 1 0 0 0 0 0 0 0 0 1 2
programming skills in
problem solving
CO 3: Solve the exceptions 2 1 3 2 3 0 0 0 0 0 0 0 2 1
and handle the exceptions in
programming

11
CO 4: Extend the knowledge 1 2 1 2 3 0 0 0 0 0 0 0 3 2
to working with files and
Connecting to the Database
CO 5: Extend their 2 1 2 3 0 0 0 0 0 0 0 0 2 3
knowledge to GUI
applications

GAPS IN THE SYLLABUS - TO MEET INDUSTRY/PROFESSION REQUIREMENTS:

SNO DESCRIPTION PROPOSED


ACTIONS
1 Collection Framework NPTEL/PPT
2 Annotations NPTEL/PPT

PROPOSED ACTIONS: TOPICS BEYOND SYLLABUS/ASSIGNMENT/INDUSTRY


VISIT/GUEST LECTURER/NPTEL ETC:

12
TOPICS BEYOND SYLLABUS/ADVANCED TOPICS/DESIGN:

1 Servlets NPTEL/PPT
2 Network Programming NPTEL/PPT

WEB SOURCE REFERENCES:

1 Sun/Oracle Java Tutorial: [Link]


2 Java Tutorial: [Link]
3 [Link]
4 [Link]
5 [Link]
6 [Link]
7 Sun/Oracle Java Tutorial: [Link]

DELIVERY/INSTRUCTIONAL METHODOLOGIES:

CHALK & TALK  STUD.  WEB  VIDEO


ASSIGNMENT RESOURCES LECTURES
 PPT/SMART  STUD.  ADD-ON
BOARD SEMINARS COURSES

13
ASSESSMENT METHODOLOGIES-DIRECT

 ASSIGNMENTS  STUD.  TESTS/MODEL  UNIV.


SEMINARS EXAMS EXAMINATION
☐ STUD. LAB ☐ STUD. VIVA ☐ MINI/MAJOR ☐
PRACTICES PROJECTS CERTIFICATIONS

☐ ADD-ON ☐ OTHERS
COURSES

ASSESSMENT METHODOLOGIES-INDIRECT

 ASSESSMENT OF COURSE OUTCOMES  STUDENT FEEDBACK ON


(BY FEEDBACK, ONCE) FACULTY (TWICE)
☐ ASSESSMENT OF MINI/MAJOR ☐ OTHERS
PROJECTS BY EXT. EXPERTS

Prepared by Approved by
[Link] HOD
Asst. Professor

Guru Nanak Institutions Technical Campus


(Autonomous)
School of Engineering & Technology

Date: 07.05.2026
Micro Lesson Plan

14
Name of the Subject: OOP Through Java Subject Code: 22PC0AD02
Class : II year-I Semester, [Link] (CSE)- IOT
Name of the Faculty Member : [Link]

No. of Cumulative
Sl. No Name of the Topic Classes number of Teaching
required periods AID
UNIT – I
OOP concepts: Classes and objects, data 1 1 Chalk/Talk,
1
abstraction PPT
encapsulation, inheritance, benefits of inheritance, 1 Chalk/Talk
2 polymorphism,
2
procedural and object oriented programming 1 Chalk/Talk,
3
paradigm; Java programming 3 PPT
4 Tutorial Class 1 4 Practice
History of Java, Java buzzwords, data types, 2 Chalk/Talk,
5
variables, 6
scope and life time of variables, arrays, operators 1 Chalk/Talk,
6
7 PPT
expressions, control statements, type conversion 1 Chalk/Talk
7
and casting, 8
8 Tutorial Class 1 9 Practice
9 simple java program, concepts of classes, objects, 1 PPT
constructors, methods, 10
access control, this keyword, garbage collection, 2 Chalk/Talk,
10 overloading methods and constructors 12 PPT
11 method binding, inheritance, overriding and 1 Chalk/Talk,
exceptions, 13 PPT
12 Parameter passing, recursion, nested and inner 1 PPT
classes, exploring string class.
14
13 Tutorial Class 1 15 Practice
14 Remedial/NPTEL 1 16 Practice
UNIT – II
15 Inheritance: Inheritance hierarchies, super and 17 PPT
1
subclasses
16 Member access rules, super uses, using final with 18 Chalk/Talk,
1
inheritance, PPT
17 preventing inheritance: final classes and methods 1 19 PPT

18 Tutorial Class 1 20 Practice


19 Polymorphism: Dynamic binding, method PPT
1 21
overriding
Interface: Interfaces vs Abstract classes, defining 22 PPT
20 1
an interface, implement interfaces
21 Packages: Defining, creating and accessing a 1 23 Chalk/Talk,

15
package, understanding CLASSPATH, importing PPT
packages
22 Tutorial Class 1 24 Practice
23 Understanding CLASSPATH, importing packages 1 25 Chalk/Talk
24 differences between classes and interfaces, 1 26 Chalk/Talk,
defining an interface PPT
25 implementing interface, applying interfaces 1 27 Chalk/Talk
26 variables in interface and extending interfaces, 2 Chalk/Talk,
Exploring [Link]. 29 PPT
27 Tutorial Class 1 30 Practice
28 Remedial/NPTEL 1 31 Practice
29 Special Descriptive test-1 1 32 Test
UNIT – III
Exception handling and Multithreading-- 1 PPT
30 Concepts of exception handling, benefits of 33
exception handling,
Termination or resumptive models, exception 1 Chalk/Talk,
31 34
hierarchy, PPT
32 Tutorial Class 1 35 Practice
33 usage of try, catch, throw, throws and finally 1 36 PPT
built in exceptions, creating own exception sub 1 PPT
34 37
classes
35 Tutorial Class 1 38 Practice
String handling,Exploring [Link]. 1 PPT
36 39
Differences between multi threading and Chalk/Talk,
37 2 41
multitasking, thread life cycle, creating threads PPT
thread priorities, synchronizing threads, inter 1 PPT
38 42
thread communication, thread groups
39 Tutorial Class 1 43 Practice
daemon threads. Enumerations, auto boxing, 2 PPT
40 45
annotations, generics
41 Remedial/NPTEL 1 46 Practice
UNIT – IV
42 Event Handling: Events, Event sources 1 47 PPT
Event Classes, Event Listeners, Delegation model 1 Chalk/Talk,
43 48
Handling mouse and keyboard events PPT
44 Adapter classes 1 49 PPT
45 Tutorial Class 1 50 Practice
46 Reading and writing Binary data 1 51 PPT

Random Access files Chalk/Talk,


47 1 52
PPT
48 File I/O using character stream. 1 53 PPT
49 Tutorial Class 1 54 Practice
Discussion of various drivers Chalk/Talk,
50 1 55
PPT

16
51 Conneting to database 1 56 PPT
querying a database Chalk/Talk,
52 1 57
PPT
53 Tutorial Class 1 58 Practice
processing the results PPT
54 1 59
55 updating data with JDBC. 1 60 PPT
updating data with JDBC. Chalk/Talk,
56 1 61
PPT
57 Tutorial Class 1 62 Practice
Topics Beyond Syllabus 2 Guest
58 64
Lecture
59 Remedial/NPTEL 1 65 Practice
60 Special Descriptive Test-2 1 66 Test
UNIT V
61 Applets – Concepts of Applets, 1 67 Chalk/Talk,
differences between applets and applications, life 1 PPT
62 68
cycle of an applet
63 types of applets, creating applets 1 69 Chalk/Talk,
64 Tutorial Class 1 70 Practice
65 passing parameters to applets. 1 71 LCD
66 Swing – Introduction, limitations of AWT 1 72 Chalk/Talk,
67 MVC architecture, components 1 73 PPT
containers, exploring swing- JApplet, JFrame 1 Chalk/Talk,
68 74

JComponent, Icons and Labels, Text fields, 1 LCD


69 75
buttons
70 Tutorial Class 1 76 Practice
JButton class, Check boxes, Radio buttons, 1 Chalk/Talk,
71 77
Combo boxes PPT
72 Tabbed Panes, Scroll Panes, Trees, and Tables 1 78S LCD
Topics Beyond Syllabus 1 Guest
73 79
Lecture
74 Tutorial Class 1 80 Practice

Total Classes 55

Tutorial Classes 10

Topics for Beyond Syllabus 03

Descriptive Tests 02

Remedial classes/NPTEL 04

Total Number of Classes 74

17
Guru Nanak Institutions Technical Campus
(Autonomous)
School of Engineering & Technology

Lecture Plan with Blooms Taxonomy


Name of the Subject: Object Oriented Programming Through Java
Subject Code : 22PC0AD02
Class : II year-I Semester, [Link](CSE) IOT
Name of the Faculty Member : Mr .[Link]
BTL- Blooms Taxonomy Level:
Level 1 – Remembering
Level 2- Understanding
Level 3- Applying
Level 4- Analyzing
Level 5- Evaluating
Level 6- Creating
Cumula Time Topics BTL Teaching–Teaching
tive (Min) Aids(PPT, OHP, LCD
Periods Projector,
Intranet/Internet, Role
play, Working model /
Visual charts, Digital
library, Video lectures)
10 UNIT-I First day: Taking Attendance in 1 Chalk/Talk,
Register PPT
20 Course Objective and Course Outcomes: 2 Chalk/Talk,
Explaining Course Objective and Course PPT
1 Outcomes of OOP through Java subject
10 Pre-requisites: Brief talk on Pre-requisites and 1 Chalk/Talk,
Introduction to Object Oriented Programming PPT
10 Conclusion: Conclusion of subject overview 3, 4 Chalk/Talk,
PPT
10 Recollecting previous topic: OOPs Concepts 1 Chalk/Talk,
PPT
20 Classes and Objects 2,3 Chalk/Talk,
2 PPT
10 Data Abstraction, Encapsulation, Inheritance 3, 4 Chalk/Talk,
PPT
10 Questionary from students and Conclusion 1,2 Chalk/Talk,
PPT

18
3 10 Revision on Previous topic on OOPs 1 Chalk/Talk,
PPT
20 Polymorphism, Paradigms of Programming 2,3 Chalk/Talk,
PPT
10 History of Java Programming 3,4 Chalk/Talk,
PPT
10 Questionary from students and Conclusion on 4 Chalk/Talk,
OOP Concepts PPT
4 10 Asking Question to students on previous topics. 1 Chalk/Talk,
Revision on Previous topic on OOPs Concepts PPT
and Java History
20 Java datatypes, variables, Constants, comments 2,3 Chalk/Talk,
PPT
10 Sample Programs on Java 3,4 Chalk/Talk,
PPT
10 Conclusion of Java datatypes, variables 4 Chalk/Talk,
PPT
5 10 Revision on previous topic Java datatype, 1 Chalk/Talk,
variables PPT
20 Scope and Life time of variables 2,3 Chalk/Talk,
PPT
10 Sample programs in Java 2,3 Chalk/Talk,
PPT
10 Conclusion on Scope and life time of variables 4 Chalk/Talk,
PPT
6 10 Revision on previous topic on Scope and life 1 Chalk/Talk,
time of variables. PPT
20 Operators and its Hierarchy 2,3 Chalk/Talk,
PPT
10 Sample program on Operators 3,4 Chalk/Talk,
PPT
10 Questionary from students and Conclusion 4 Chalk/Talk,
PPT
7 10 Questions on previous topic 1 Chalk/Talk,
Revision on previous topic PPT
20 Expressions and statements 2,3 Chalk/Talk,
PPT
10 Sample programs in Java 3,4 Chalk/Talk,
PPT
10 Questionary from students and Conclusion 4,5 Chalk/Talk,
PPT
8 10 Revision on Expression and statements 1 Chalk/Talk,
PPT

19
20 Type conversion and casting 2,3 Chalk/Talk,
PPT
10 Enumerated Data types 3,4 Chalk/Talk,
PPT
10 Questionary from students and Conclusion on 4,5 Chalk/Talk,
Type conversion and Enumerated datatypes PPT
9 10 Question on Previous Topic 1 Chalk/Talk,
PPT
20 Control Statements and Jump statements 2,3 Chalk/Talk,
PPT
10 Sample Programs in Java 3,4 Chalk/Talk,
PPT
10 Questionary from students and Conclusion on 4 Chalk/Talk,
Control Statements PPT
10 10 Revision on Previous topic 1 Chalk/Talk,
PPT
20 Arrays in Java 2,3 Chalk/Talk,
PPT
10 Console Input and Output Programming 3,4 Chalk/Talk,
PPT
10 Conclusion on Arrays 4 Chalk/Talk,
PPT
11 10 Question on Previous topic 1 Chalk/Talk,
PPT
20 Constructors and Parameter Passing 2,3 Chalk/Talk,
PPT
10 Static Fields and methods 3,4 Chalk/Talk,
PPT
10 Conclusion on Constructors 5 Chalk/Talk,
PPT
12 10 Question from Previous topic on Constructors 1 Chalk/Talk,
PPT
20 Overloading and Overriding concepts 2,3 Chalk/Talk,
PPT
10 Sample Programs in Java 3,4 Chalk/Talk,
PPT
10 Questionary from students and Conclusion on 4,5 Chalk/Talk,
Overloading and Overriding PPT
13 10 Question from Previous topic on Overloading 1 Chalk/Talk,
and Overriding PPT
20 Garbagge collection 2,3 Chalk/Talk,
PPT
10 String Classes 3,4 Chalk/Talk,
PPT

20
10 Questionary from students and Conclusion 4,5 Chalk/Talk,
PPT
14 10 Questions on Previous Topic and Revision on 1 Chalk/Talk,
Unit-I PPT
20 Inheritance , hierarchy, Super and Sub classes 2,3 Chalk/Talk,
PPT
10 Super Class 4 Chalk/Talk,
PPT
10 Conclusion on Inheritance 5 Chalk/Talk,
PPT
15 10 Questionary on Previous topic and Revision on 1 Chalk/Talk,
Inheritance PPT
20 Final Class and methods 2,3 Chalk/Talk,
PPT
10 Object classes and its methods 3,4 Chalk/Talk,
PPT
10 Conclusion on Final Class 4,5 Chalk/Talk,
PPT
16 10 Revision on Previous topic on Final Class 1 Chalk/Talk,
PPT
20 Polymorphism Concepts- Dynamic binding 2,3 Chalk/Talk,
PPT
10 Method Overriding 3,4 Chalk/Talk,
PPT
10 Conclusion on Overriding 5 Chalk/Talk,
PPT
17 10 Revision on Previous topic on Overriding 1 Chalk/Talk,
PPT
20 Abstract Classes and methods 2,3 Chalk/Talk,
PPT
10 Interfaces Concepts 3,4 Chalk/Talk,
PPT
10 Conclusion on Interfaces 4,5 Chalk/Talk,
PPT
18 10 Revision on Previous topic on Interfaces 1 Chalk/Talk,
PPT
20 Implementing interfaces and methods 2.3 Chalk/Talk,
PPT
10 Extending interfaces 3,4 Chalk/Talk,
PPT
10 Questionary from students and Conclusion on 4,5 Chalk/Talk,
Interfaces PPT
19 10 Question to Students on previous topic 1 Chalk/Talk,
Interfaces PPT

21
20 Packages -creating, defining and accessing 2,3 Chalk/Talk,
PPT
10 Understanding CLASSPATH 3,4 Chalk/Talk,
PPT
10 Question from students and Conclusions on 5 Chalk/Talk,
Packages PPT
20 10 Question to Students on previous topic 1 Chalk/Talk,
Packages PPT
20 Importing packages -[Link], [Link] 2,3 Chalk/Talk,
PPT
10 Classes and Methods 3,4 Chalk/Talk,
PPT
10 Question from students and Conclusions on 5 Chalk/Talk,
Packages PPT
10 Revision on Previous Unit-II 1 Chalk/Talk,
21 PPT
20 Exception handling-benefits 2,3 Chalk/Talk,
PPT
10 Classification of Exception 3,4 Chalk/Talk,
PPT
10 Conclusion on Exception 5 Chalk/Talk,
PPT
22 10 Question to Students on previous topic 1 Chalk/Talk,
Exception PPT
20 Checked and Unchecked Exception 2,3 Chalk/Talk,
PPT
10 Exception Hierarchy 3,4 Chalk/Talk,
PPT
10 Conclusion on All-pair Shortest path Problem 5 Chalk/Talk,
PPT
23 10 Question to students on previous topic and 1 Chalk/Talk,
Revision on Exception Handling PPT
20 Methods -try,catch,throw,throws,finally 2,3 Chalk/Talk,
PPT
10 Sample Programs in exception 3,4 Chalk/Talk,
PPT
10 Conclusion on Exceptions 5 Chalk/Talk,
PPT
24 10 Question to students on previous topic and 0,1 Chalk/Talk,
Revision on try,catch keywords PPT
20 Exception Specification 2,3 Chalk/Talk,
PPT
10 Built in Exception 3,4 Chalk/Talk,

22
PPT
10 Conclusion on Exception Specification 5 Chalk/Talk,
PPT
25 10 Question to students on Exception Specification 1 Chalk/Talk,
PPT
20 Multithreading Concepts 1 Chalk/Talk,
PPT
10 Mutiple Threads, Thread States 1 Chalk/Talk,
PPT
10 Solving Part-A Questions 2 Chalk/Talk,
PPT
26 10 Question to students on Threads 1 Chalk/Talk,
PPT
20 Creating Threads, 2,3 Chalk/Talk,
PPT
10 Interrupting Threads 3,4 Chalk/Talk,
PPT
10 Conclusion on Threads 5 Chalk/Talk,
PPT
27 10 Revision on previous topic Threads 1 Chalk/Talk,
PPT
20 Thread Priorities 2,3 Chalk/Talk,
PPT
10 Synchrozing Threads 3,4 Chalk/Talk,
PPT
10 Questionary from students and Conclusion on 5 Chalk/Talk,
Thread Priorities PPT
28 10 Revision on previous topic on Thread Priorities 1 Chalk/Talk,
PPT
20 Inter communication threads 2,3 Chalk/Talk,
PPT
10 Sample Programs 3,4 Chalk/Talk,
PPT
10 Conclusion on Inter-Comm Threads 5 Chalk/Talk,
PPT
29 10 Revision on previous topic on UNIT-III 1 Chalk/Talk,
PPT
20 Introduction to Event Handling 2,3 Chalk/Talk,
PPT
10 Event Resources 3,4 Chalk/Talk,
PPT
10 Event Containers 4,5 Chalk/Talk,
PPT
30 10 Question to students and Revision on Files 1 Chalk/Talk,

23
PPT
20 Binary I/O Files 2,3 Chalk/Talk,
PPT
10 Random access file 3,4 Chalk/Talk,
PPT
10 Conclusion on Binary and Random Access 4,5 Chalk/Talk,
Files PPT
31 10 Question to students and Revision on Random 1 Chalk/Talk,
Access files PPT
20 File Operations 2,3 Chalk/Talk,
PPT
10 Sample Programs on files 3,4 Chalk/Talk,
PPT
10 Conclusion on Files 4,5 Chalk/Talk,
PPT
32 10 Question to students and Revision on File 1 Chalk/Talk,
Operations PPT
20 File Management using file method 2,3 Chalk/Talk,
PPT
10 Sample Programs on File Management 3,4 Chalk/Talk,
PPT
10 Conclusion on File Management 4,5 Chalk/Talk,
PPT
33 10 Question to students and Revision on File 1 Chalk/Talk,
Management PPT
20 Connecting to a database 2,3 Chalk/Talk,
PPT
10 JDBC connecvity 3,4 Chalk/Talk,
PPT
10 Conclusion on JDBC 4,5 Chalk/Talk,
PPT
34 10 Questions to students and Revision on File Mgt 1 Chalk/Talk,
PPT
20 Querying the database 2,3 Chalk/Talk,
PPT
10 Sample Program 3,4 Chalk/Talk,
PPT
10 Adapter classes 5 Chalk/Talk,
PPT
35 10 Handling Mouse and Keyboard 1 Chalk/Talk,
PPT
20 Processing the database 2,3 Chalk/Talk,
PPT

24
10 Program in Java 3,4 Chalk/Talk,
PPT
10 Delegation Events 5 Chalk/Talk,
PPT
36 10 Question to students on JDBC Connectivity 1 Chalk/Talk,
PPT
20 Updating Database 2,3 Chalk/Talk,
PPT
10 Sample Program in Java 3,4 Chalk/Talk,
PPT
10 Solving Part-A Question and Answers 3,4 Chalk/Talk,
PPT
37 10 UNIT-V: Revision on Unit-IV 1 Chalk/Talk,
PPT
20 Introduction to AWT& GUI Programming 2,3 Chalk/Talk,
PPT
10 AWT hierarchy, GUI 3,4 Chalk/Talk,
PPT
10 Conclusion on AWT 5 Chalk/Talk,
PPT
38 10 Questions to students on AWT 0,1 Chalk/Talk,
PPT
20 Introduction to Swings 2,3 Chalk/Talk,
PPT
10 AWT vs Swings 3,4 Chalk/Talk,
PPT
10 Conclusion on AWT vs Swings 3,4 Chalk/Talk,
PPT
39 10 Questions to students on AWT & Swings 1 Chalk/Talk,
PPT
20 Hierarchy of swing components 2,3 Chalk/Talk,
PPT
10 Containers 3,4 Chalk/Talk,
PPT
10 Conclusion on Swing Components 5 Chalk/Talk,
PPT
40 10 Questions to students on Swing Components 1 Chalk/Talk,
PPT
20 JFrame Component 2,3 Chalk/Talk,
PPT
10 Program in Java 3,4 Chalk/Talk,
PPT
10 Conclusion on JFrame 3,4 Chalk/Talk,
PPT

25
41 10 Questions to students on JFrame 1 Chalk/Talk,
PPT
20 JApplet 2,3 Chalk/Talk,
PPT
10 Program in Java 3,4 Chalk/Talk,
PPT
10 Conclusion on JApplet 5 Chalk/Talk,
PPT
42 10 Questions to students on JApplet 1 Chalk/Talk,
PPT
20 JDialog 2,3 Chalk/Talk,
PPT
10 Program in Java 3,4 Chalk/Talk,
PPT
10 Conclusion on JDialog 5 Chalk/Talk,
PPT
43 10 Questions to students on JDialog 1 Chalk/Talk,
PPT
20 JPanel 2,3 Chalk/Talk,
PPT
10 Program in Java 3,4 Chalk/Talk,
PPT
10 Conclusion on JPanel 3,4 Chalk/Talk,
PPT
44 10 Questions to students on JPanel 1 Chalk/Talk,
PPT
20 Compoents JButton 2,3 Chalk/Talk,
PPT
10 Program in Java 3,4 Chalk/Talk,
PPT
10 Conclusion on JButton 5 Chalk/Talk,
PPT
45 10 Questions to students on JButton 1 Chalk/Talk,
PPT
20 JLabel 2,3 Chalk/Talk,
PPT
10 Program in Java 3,4 Chalk/Talk,
PPT
10 Conclusion on JLabel 4,5 Chalk/Talk,
PPT
46 10 Questions on Previous topic JLabel 1 Chalk/Talk,
PPT
20 JTextField 2,3 Chalk/Talk,
PPT

26
10 Program in Java 3,4 Chalk/Talk,
PPT
10 Conclusion on JTextField 4,5 Chalk/Talk,
PPT
47 10 Questions on Previous topic JTextField 1 Chalk/Talk,
PPT
20 JTextArea 2,3 Chalk/Talk,
PPT
10 Program in Java 3,4 Chalk/Talk,
PPT
10 Conclusion on JText Area 4,5 Chalk/Talk,
PPT
48 10 Revision on JTextArea 1 Chalk/Talk,
PPT
20 Layout Mangement 2,3 Chalk/Talk,
PPT
10 Program in Java 3,4 Chalk/Talk,
PPT
10 Conclusion on Layout Mangement 4,5 Chalk/Talk,
PPT
49 10 Questions to students on Layout Management 1 Chalk/Talk,
PPT
20 Border Layout 2,3 Chalk/Talk,
PPT
10 Program in Java 3,4 Chalk/Talk,
PPT
10 Conclusion to Border Layout 4,5 Chalk/Talk,
PPT
50 10 Questions to students on Border Layout 1 Chalk/Talk,
PPT
20 Flow Layout 2,3 Chalk/Talk,
PPT
10 Java Program 3,4 Chalk/Talk,
PPT
10 Conclusion to Flow Layout 5 Chalk/Talk,
PPT
51 10 Questions to students on Flow layout 1 Chalk/Talk,
PPT
20 Grid Layout 2,3 Chalk/Talk,
PPT
10 Program in Java 3,4 Chalk/Talk,
PPT
10 Conclusion to Grid Layout 4,5 Chalk/Talk,
PPT

27
52 10 Questions to students on Grid Layout 1 Chalk/Talk,
PPT
20 Introduction to Applets & its importances 2,3 Chalk/Talk,
PPT
10 Program in Java 3,4 Chalk/Talk,
PPT
10 Conclusion to Applets 5 Chalk/Talk,
PPT
53 10 Questions to students on Applets 1 Chalk/Talk,
PPT
20 Life Cycle of applets 2,3 Chalk/Talk,
PPT
10 Linking of Applet with browser 3,4 Chalk/Talk,
PPT
10 Conclusion to Applet 4,5 Chalk/Talk,
PPT
54 10 Questions to students on Applet 1 Chalk/Talk,
PPT
20 Applets and Application 2,3 Chalk/Talk,
PPT
10 Program in Java 3,4 Chalk/Talk,
PPT
10 Conclusion to Applets and Application 5 Chalk/Talk,
PPT
55 10 Questions to students on Applets 1 Chalk/Talk,
PPT
20 Parameter Passing to Applets 2,3 Chalk/Talk,
PPT
10 Program in Java 3,4 Chalk/Talk,
PPT
10 Conclusion to Parameter Passing to Applets 4,5 Chalk/Talk,
PPT
56 10 Questions to students on Parameter Passing to 1 Chalk/Talk,
Applets PPT
20 Applet Program-1 2,3 Chalk/Talk,
PPT
10 Applet Program-2 3,4 Chalk/Talk,
PPT
10 Conclusion to – Applet Program 5 Chalk/Talk,
PPT
57 10 Questions to students on Applets 1 Chalk/Talk,
PPT
20 Program on Swings-1 2,3 Chalk/Talk,
PPT

28
10 Program on Swings-2 3,4 Chalk/Talk,
PPT
10 Conclusion to Swings 4,5 Chalk/Talk,
PPT
58 10 Questions to students on OOPs 1 Chalk/Talk,
PPT
20 Unit-I Part-A Question bank 2,3 Chalk/Talk,
PPT
10 Part-B Question bank 3,4 Chalk/Talk,
PPT
10 Conclusion 4 Chalk/Talk,
PPT
59 10 Questions to students 1 Chalk/Talk,
PPT
20 Unit-II Part-A Question bank 2,3 Chalk/Talk,
PPT
10 Part-B Question bank 3,4 Chalk/Talk,
PPT
10 Conclusion 4,5 Chalk/Talk,
PPT
60 10 Question to students 1 Chalk/Talk,
PPT
20 Unit-III Part-A Question bank 2,3 Chalk/Talk,
PPT
10 Part-B Question bank 3,4 Chalk/Talk,
PPT
10 Conclusion 2 Chalk/Talk,
PPT

29
Guru Nanak Institutions Technical Campus
(Autonomous)
School of Engineering & Technology
Department of Computer science & Engineering

PART A & PART B with Blooms Taxonomy Level (BTL)


University Question Bank

Subject Name with code: OOPS through Java (22PC0AD04)


Class: II Year/ I-Sem
Name of the Faculty Member: Mr .[Link]
Academic Year: 2026-27

UNIVERSITY QUESTION PAPERS REFERRED:


A) JNTUH MAY-2018,R16
B) JNTUH DEC-2018,R18
C) JNTUH DEC-2017,R16
D) JNTUH DEC-2018,R15
E) JNTUH DEC-2017,R13
F) JNTUH MAY-2017,R15
G) JNTUH MAY-16,R13
H) JNTUH MAY-15,R13
I) JNTUH NOV-16,R13
J) GNITC DEC 2019,R18
K) GNITC NOV 2020,R18

Blooms Taxonomy Levels (BTL)


Remembering
Understanding
Applying
Analyzing
Evaluating
Creating

PART A -QUESTIONS

UNIT I: OOP concepts

Question Marks BTL Course


level Outcome
1. What is the size of char data type ? Why does it differ from C 2 L1
CO1
language(JNTUH DEC-17,R13)
2. Define Data abstraction(JNTUH DEC-2017,R13) 2 L1 CO1
3. What are the features of Java Language (JNTUH MAY-17,R15) 2 L1 CO1
4. list the types of operators used in java (JNTUH MAY-17,R15) 2 L1 CO1
5. What is Static Inner class(JNTUH MAY-17,R15) 2 L1 CO1

30
6. Distinguish between break and continue (JNTUH MAY-16,R13) 3 L1 CO1
7. What is type casting(JNTUH MAY-16,R13) 3 L1 CO1
8. List String Manipulation function of Java String class(JNTUHMAY- 3 L1
CO1
15,R13)
9. Define Polymorphism(JNTUH NOV-16,R13) 3 L1 CO1
10. Why java is known as Platform Independent(JNTUH NOV-16,R13) 3 L1 CO1

PART B -QUESTIONS

UNIT I: OOP concepts

Question Marks BTL Course


level Outcome
[Link] the structure of a typical Java program with an 5 L2
CO1
example(JNTUH DEC-18,R16)
[Link] the significance of Java Virtual Machine (JNTUH DEC-18,R16) 5 L1 CO1
[Link] do we implement polymorphism in Java (JNTUH DEC-18,R16) 5 L2 CO1
4. What is a Array? How to declare Array in Java ? Give Examples 5 L1
CO1
(JNTUH DEC-18,R16)
[Link] is inheritance and how does it help to create new classes 5 L2
CO1
quickly(JNTUH MAY-18,R16)
[Link] different levels of access protection available in Java( JNTUH 5 L1
CO1
MAY-18,R16)
[Link] and explain the primitive data types available in Java ( JNTUH 5 L1
CO1
MAY-18,R16)
[Link] is polymorphism ? Explain different types of polymorphisms with 5 L1
CO1
example( JNTUH MAY-18,R16)
[Link] is meant by byte code ? Briefly explain how Java is platform 5 L1
CO1
independent(JNTUH DEC-17,R16)
[Link] the significance of public,protected and private access 5 L1
CO1
specifiers in inheritance(JNTUH DEC-17,R16)

UNIT II: Inheritance

PART A -QUESTIONS

Question Marks BTL Course


level Outcome
1. What is package ? (JNTUH DEC-2017,R13) 2 L1 CO2
2. What is the use of Super keyword( JNTUH MAY-16,R13) 2 L1 CO2
3. Distinguish between abstract class and concrete class(MAY- 2 L2
CO2
16,R13/ JNTUH,R15JNTUH DECEMBER-2018)
4. What is java package? What is CLASSPATH(JNTUH MAY- 3 L1
CO2
17,R15/ JNTUH MAY-2018,R16)
5. Differentiate between interface and Abstract Class (JNTUH MAY- 3 L2 CO2

31
15/R13, JNTUH JUNE-14/ JNTUH,R15 DECEMBER-2018)
6. What are the uses of final keyword in java-(JNTUH MAY-15,R13/ 3 L1
CO2
JNTUH,R15 DECEMBER-2018)
7. What is Runtime Polymorphism(JNTUH ,JUNE-14) 3 L1 CO2
[Link] is the significance of the Classpath environment variable in 2 L1 CO2
creating/using a package(JNTUH DEC-2017,R16)
[Link] is abstract class ?Give example(JNTUH MAY-2018,R16) 2 L2 CO2
[Link] a java program to demonstrate hierarchical and multiple 3 L2 CO2
inheritance using interfaces.(GNITC OCT 2020 R18)

PART B –QUESTIONS

Question Marks BTL Course


level Outcome
1. What is package ? How do you create a package with suitable 10 L1 CO2
examples(JNTUH DEC-17,R16)
[Link] an example where interface can be used to support multiple 5 L1 CO2
inheritance(JNTUH DEC-17,R16/(JNTUH MAY-2018,R16))
[Link] is the accessibility of a public method or field inside a non 10 L1 CO2
public class or interface ? Explain(JNTUH DEC-17,R16)
[Link] is an interface ? What are the similarities between interface 5 L1 CO2
and classes(JNTUH MAY-2018,R16)
[Link] can you extend one interface by the other interface ? Discuss 5 L1 CO2
(JNTUH MAY-2018,R16)
[Link] about CLASSPATH environment variables (JNTUH MAY- 5 L1 CO2
2018,R16)
[Link] to design and implement interface in Java ? Give 5 L2 CO2
Example(JNTUH MAY-2018,R16)
[Link] are the three uses of final keyword ? Explain with 5 L1 CO2
example(JNTUH MAR-17,R13)
[Link] a comparison between the Classes and Interfaces (JNTUH 5 L2 C02
NOV-16,R13)
10. How can you extend one interface by the other interface? 5 L1 C02
Discuss.(GNITC OCT 2020 R18)

UNIT III: Exception Handling

PART A -QUESTIONS

Question Marks BTL Course


level Outcome
[Link] between error and exception(JNTUH DEC-17,R16) 2 L1 CO3
[Link] how multiple catch statements work-(JNTUH MAY- 3 L2
CO3
17,R15,JNTUH,R15 DECEMBER-2018)

32
[Link] are the advantages of multithreading (JNTUH MAY-16,R13/) 3 L1 CO3
4. What are the types of Exceptions(JNTUH MAY-16,R13) 3 L1 CO3
[Link] any six built-in exceptions in java(JNTUH MAY-15,R13) 3 L1 CO3
[Link] are checked and unchecked Exceptions(JNTUH R13,MAY- 3 L1
CO3
16)
[Link] is Synchronization and why it is important(JNTUH DEC- 3 L1
CO3
17,R16)
[Link] do we start and stop a thread(JNTUH MAY-18,R16) 3 L2 CO3
[Link] the complete life cycle of thread(JNTUH MAY-18,R16) 3 L1 CO3
[Link] do we set Priorities for threads(JNTUH MAY-18,R16) 3 L1 CO3

PART B -QUESTIONS

Question Marks BTL Course


level Outcome
1. Write a program to use multiple catch blocks in a try block(JNTUH 10 L2
CO3
,R13,DEC-2017/ JNTUH,R15 DECEMBER-2018)
[Link] is an Exception ? How is an Exception handled in 5 L1 CO3
Java(JNTUH DEC-18,R16)
[Link] between multiprocessing and multithreading . (JNTUH 5 L2 CO3
DEC-2018,R16)
[Link] are the advantages of using Exception handling mechanism in 5 L1 CO3
a program(JNTUH MAY-18,R16)
[Link] a java program that demonstrates how certain exception types 5 L2 CO3
are not allowed to be thrown (JNTUH MAY-2018,R16)
[Link] are the different ways that are possible to create multiple 5 L2 CO3
threaded programs in Java ? Discuss the differences between
them(JNTUH MAY-2018,R16)
[Link] a program to create four threads using Runnable 5 L3 CO3
interface(JNTUH MAY-2018,R16)
[Link] between checked and unchecked exceptions with 5 L2 CO3
examples(JNTUH DEC-17,R16)
[Link] are the different ways to handle exceptions ? Explain(JNTUH 5 L1 CO3
MAY-2018,R16)
[Link] many ways are possible in java to create multithreaded 5 L1 CO3
programs ? Discuss the differences between them(JNTUH MAY-
2018,R16)

UNIT IV: Files


PART A -QUESTIONS

Question Marks BTL Course


level Outcome
[Link] byte streams with Character Stream( JNTUH,R15 2 L2 CO4
DECEMBER-2018)
[Link] file access operations( JNTUH,R15 DECEMBER-2018) 2 L1 CO4

33
[Link] are the methods available in Character Stream(JNTUH, DEC- 3 L1 CO4
17 R16)
[Link] types of streams does java define? ( JNTUH,R15 3 L1 CO4
DECEMBER-2018)
[Link] streams are used to read and write binary data? R15 2 L1 CO4
DECEMBER-2018
[Link] the syntax to create a random file ( JNTUH April/May -2018) 3 L1 CO4
[Link] class is used to read characters from a file? Write the syntax? 2 L1 CO4
(JNTUHMay 2018)
[Link] method is used to list the files in a directory?(JNTUH Dec 2 L1 CO4
2018)
[Link] a program to compare two files? ( JNTUH,R15 DECEMBER- 2 L2 CO4
2018)
[Link] is the use of FileInputStream and FileOutputStream? 2 L1 CO4
(JNTUH,R15 DECEMBER-2018)

PART B -QUESTIONS

Question Marks BTL Course


level Outcome
1. What are the methods available in the Character Stream(JNTUH 5 L1 CO4
DEC-18,R16)
[Link] between Byte Stream and Character Stream Classes( 5 L2 CO4
JNTUH DEC-18,R16)
[Link] the types of drivers used in JDBC(JNTUH MAY-16,R13) 5 L2 CO4
4. What is JDBC? Explain the role & responsibility of JDBC API. 5 L2 CO4
(GNITC DEC 2019).
5. What is Driver Manager Class? Explain the types of JDBC Driver 5 L2 CO4
with suitable diagram. (GNITC DEC 2019).
6. What is Thin Driver? Which driver is fast among the four JDBC 5 L2 CO4
drivers? Justify.(GNITC DEC 2019
7. What is statement? Explain the types of statement in JDBC. ? 5 L2 CO4
(JNTUH DEC-18,R16)
[Link] to read and write files in java? Explain with example? JNTUH 5 L2 CO4
MAY-16,R13)
[Link] a Program to display the details of a user created file. (Name, 5 L2 CO4
length, path, absolute path, read and write mode). (JNTUH, DEC-17
R16)
[Link] a program for file using the seek() of various locations? 5 L2 CO4
(JNTUH DEC-18,R16)

UNIT V: GUI Programming with Java

PART A -QUESTIONS

34
Question Marks BTL Course
level Outcome
1. What is the use of Layout Manager(MAY-17,DEC-17 JNTUH R13) 2 L1 CO5
2. Give the hierarchy for swing components(JNTUH DEC-17,R13) 2 L1 CO5
3. What are the containers available in Swings(JNTUH MAY-15,R13) 3 L1 CO5
[Link] between Applet and Application(JNTU MAY-16,MAY- 3 L1 CO5
15,R13)
5. What are the limitations of AWT(JNTUH MAY-18,R16) 3 L1 CO5
[Link] do applet class need to be declared as public (JNTUH MAY- 2 L1 CO5
18,R16)
[Link] is Swing in Java? How it is differs from Applet(JNTUH DEC- 2 L1 CO5
18,R16)
[Link] do Java applets differ from Application programs (JNTUH 3 L2 CO5
DEC-18,R16)
[Link] the types of containers? (JNTUH DEC-18,R16) 2 L1 CO5
[Link] a simple program for swing? JNTUH MAY-18,R16) 2 L2 CO5

PART B -QUESTIONS

Question Marks BTL Course


level Outcome
1. Explain about parameter passing to applets(R13,JNTUH MAR-17) 10 L2 CO5
[Link] is the difference between init() and start() methods in an 5 L2 CO5
Applet ? When will each be executed ?(JNTUH DEC-18,R16)
[Link] the applets to draw the Cube and Circle/Cylinder shapes 5 L2 CO5
(JNTUH DEC-18,R16/ JNTUH MAY-18,R16)
[Link] various layout managers in Java (JNTUH DEC-18,R16/ 5 L1 CO5
JNTUH MAY-18,R16)
[Link] is an Applet? Explain the life cycle of Applet with neat sketch 5 L1 CO5
(JNTUH MAY-18,R16
[Link] a program that create a frame window that responds to key 5 L2 CO5
strokes (JNTUH MAY-18,R16)
[Link] about different applet display methods in brief(JNTUH 5 L2 CO5
DEC-17,R16)
[Link] the various components of Swings (JNTUH DEC-17,R16) 5 L1 CO5
[Link] move or drag component placed in Swing Container( 5 L2 CO5
JNTUH DEC-17,R16
10. Write a Swing Program using checkboxes and radio 10 L2 CO5
buttons(R07,JNTUH DEC-15)

35
Part-A Solutions
UNIT-I:

1. What is the size of char data type ? Why does it differ from C language(JNTUH
DEC-17,R13)
Ans: The char data type is a single 16-bit Unicode character. It has a minimum value
of '\u0000' (or 0) and a maximum value of '\uffff' (or 65,535 inclusive).

2. Define Data abstraction. (JNTUH DEC-2017,R13)


Ans: In Object-oriented programming, abstraction is a process of hiding the implementation
details from the user, only the functionality will be provided to the user. In other words, the
user will have the information on what the object does instead of how it does it.

3. What are the features of Java Language (JNTUH MAY-17,R15)


Ans: 11 Features of Java Programming Language
 Simple
 Secure
 Portable
 Object-oriented
 Robust
 Multithreaded
 Architecture-neutral
 Interpreted
 High performance
 Distributed
 Dynamic

4. List the types of operators used in java (JNTUH MAY-17,R15)

36
Ans: Java provides a rich set of operators to manipulate variables. We can divide all the Java
operators into the following groups
 Arithmetic Operators
 Relational Operators
 Bitwise Operators
 Logical Operators
 Assignment Operators

5. What is Static Inner class(JNTUH MAY-17,R15)

Ans: A static inner class is a nested class which is a static member of the outer class. It can
be accessed without instantiating the outer class, using other static members. Just like static
members, a static nested class does not have access to the instance variables and methods of
the outer class.
Syntax:
class MyOuter
{
static class Nested_Demo
{
}
}

6. Distinguish between break and continue (JNTUH MAY-16,R13)

Ans:
Break statement: The break statement is used with the conditional switch statement and
with the do, for, and while loop statements. When a break statement is encountered inside a
loop, the loop is immediately terminated and the program control resumes at the next
statement following the loop.

Continue statement: Continue statement works like break but instead of forcing termination,
it forces the next iteration of the loop to take place and skipping the rest of the code.
Continue statement is mostly used inside loops, whenever it is encountered inside a loop,
either conditionally or unconditionally, transfers control to the next iteration of either the
current loop or an enclosing labeled loop.

7. What is type casting(JNTUH MAY-16,R13)

Ans: Assigning a value of one type to a variable of another type is known as Type Casting.
Example : int x = 10;
byte y = (byte)x;

8. List String Manipulation function of Java String class(JNTUHMAY-15,R13)


Ans: Strings, which are widely used in Java programming, are a sequence of characters. In
Java programming language, strings are treated as objects.
 char charAt(int index) : Returns the character at the specified index

37
 String concat(String str): Concatenates the specified string to the end of this
string.
 int indexOf(int ch, int fromIndex) :Returns the index within this string of the first
occurrence of the specified character, starting the search at the specified index.
 int length():Returns the length of this string

9. Define Polymorphism(JNTUH NOV-16,R13)


Ans: Polymorphism is the ability of an object to take on many forms. The most common use
of polymorphism in OOP occurs when a parent class reference is used to refer to a child class
object.

10. Why java is known as Platform Independent(JNTUH NOV-16,R13)


Ans: The compiler converts source code file into bytecode files. These codes are machine
independent and can be run on any machine. Java interpreter reads the bytecode files and
translates them into machine code for the specific machine on which the Java program in
running

UNIT II:

1. What is package ? How to define it and access it? (JNTUH DEC-2017,R13)

Ans:A java package is a group of similar types of classes, interfaces and sub-
[Link] in java can be categorized in two form, built-in package and user-defined
[Link] are many built-in packages such as java, lang, awt, javax, swing, net, io, util,
sql [Link], we will have the detailed learning of creating and using user-defined packages.

2. What is the use of Super keyword( JNTUH MAY-16,R13)

Ans: The super keyword in java is a reference variable which is used to refer immediate
parent class object. Whenever you create the instance of subclass, an instance of parent
class is created implicitly which is referred by super reference variable.

Usage of java super Keyword:

 super can be used to refer immediate parent class instance variable.


 super can be used to invoke immediate parent class method.
 super() can be used to invoke immediate parent class constructor.

3. Distinguish between abstract class and concrete class. (MAY-16,R13/


JNTUH,R15JNTUH DECEMBER-2018)

38
Ans: Abstract classes usually have partial or no implementation. On the other hand, concrete
classes always have full implementation of its behavior. Unlike concrete classes, abstract
classes cannot be instantiated. Therefore abstract classes have to be extended in order to
make them useful. Abstract classes may contain abstract methods, but concrete classes
can’t. When an abstract class is extended, all methods (both abstract and concrete) are
inherited. The inherited class can implement any or all the methods. If all the abstract
methods are not implemented, then that class also becomes an abstract class.

4. What is java package? What is CLASSPATH? (JNTUH MAY-17,R15/ JNTUH


MAY-2018,R16)
Ans: A Package can be defined as a grouping of related types (classes, interfaces,
enumerations and annotations) providing access protection and namespace management.
The classpath is an environment variable. It is used to let the compiler know where the
class files are available for import.

5. Differentiate between interface and Abstract Class (JNTUH MAY-15/R13, JNTUH


JUNE-14; JNTUH, R15 DECEMBER-2018)
Ans:
Abstract class Interface
1) Abstract class can have abstract and non- Interface can have only abstract methods. Since
abstract methods. Java 8, it can have default and static methods also.
2) Abstract class doesn't support multiple
Interface supports multiple inheritance.
inheritance.
3) Abstract class can have final, non-final,
Interface has only static and final variables.
static and non-static variables.
4) Abstract class can provide the Interface can't provide the implementation of
implementation of interface. abstract class.
5) The abstract keyword is used to declare
The interface keyword is used to declare interface.
abstract class.

6. What are the uses of final keyword in java-(JNTUH MAY-15,R13/ JNTUH,R15


DECEMBER-2018)
Ans: The final keyword in java is used to restrict the user. The java final keyword can be
used in many context. Final can be:
 Variable
 Method
 Class
 Java final variable: If you make any variable as final, you cannot change the value of final
variable(It will be constant).
 Java final method: If you make any method as final, you cannot override it.
 Java final class: If you make any class as final, you cannot extend it.

7. What is Runtime Polymorphism(JNTUH ,JUNE-14)


Ans: Runtime polymorphism or Dynamic Method Dispatch is a process in which a call to an
overridden method is resolved at runtime rather than compile-time.

39
In this process, an overridden method is called through the reference variable of a superclass.
The determination of the method to be called is based on the object being referred to by the
reference variable.

8. What is the significance of the Classpath environment variable in creating/using a


package(JNTUH DEC-2017,R16)
Ans: Classpath is a parameter in the Java Virtual Machine or the Java compiler that specifies
the location of user-defined classes and packages. The parameter may be set either on
the command-line, or through an environment variable.

9. What is abstract class ?Give example(JNTUH MAY-2018,R16)


Ans: A class which is declared with the abstract keyword is known as an abstract class in
Java. It can have abstract and non-abstract methods (method with the body).
abstract class Bike{
abstract void run();
}
class Honda4 extends Bike{
void run(){[Link]("running safely");}
public static void main(String args[]){
Bike obj = new Honda4();
[Link]();
}
}

10. Write a java program to demonstrate hierarchical and multiple inheritance using
interfaces.(GNITC OCT 2020 R18)

40
interface AnimalEat

void eat();

interface AnimalTravel

void travel();

class Animal implements AnimalEat, AnimalTravel {

public void eat() {

[Link]("Animal is eating");

public void travel() {

[Link]("Animal is travelling");

public class Demo {

public static void main(String args[])

Animal a = new Animal();

[Link]();

[Link]();

41
UNIT III

1. Differentiate between error and exception(JNTUH DEC-17,R16)


Ans:
Both [Link] and [Link] classes are sub classes
of [Link] class,but there exist some significant differences between
them. [Link] class represents the errors which are mainly caused by the
environment in which application is running.

2. Explain how multiple catch statements work. (JNTUH MAY-17, R15, JNTUH,R15
DEC-2018)
Ans: A try block can be followed by multiple catch blocks. The syntax for multiple catch
blocks looks like the following –
Syntax:
try {
// Protected code
}
catch(ExceptionType1 e1)
{
// Catch block
}
catch(ExceptionType2 e2)
{
// Catch block
}
catch(ExceptionType3 e3)
{
// Catch block
}

3. What are the advantages of multithreading (JNTUH MAY-16,R13/)


Ans:
 Reduces the computation time.
 Improves performance of an application.
 Threads distribute the same address space so it saves the memory.
 Context switching between threads is usually less costly than between processes.
 Cost of communication between threads is comparatively low.

4. What are the types of Exceptions(JNTUH MAY-16,R13)


Ans: An exception (or exceptional event) is a problem that arises during the execution of a
program.
Checked exceptions − A checked exception is an exception that occurs at the compile time,
these are also called as compile time exceptions. These exceptions cannot simply be ignored
at the time of compilation, the programmer should take care of (handle) these exceptions.
Unchecked exceptions − An unchecked exception is an exception that occurs at the time of
execution. These are also called as Runtime Exceptions. These include programming bugs,

42
such as logic errors or improper use of an API. Runtime exceptions are ignored at the time of
compilation.

5. List any six built-in exceptions in java(JNTUH MAY-15,R13)


 ArithmeticException
 ArrayIndexOutOfBoundsException
 ArrayStoreException
 IndexOutOfBoundsException
 NumberFormatException
 ClassNotFoundException

6. What are checked and unchecked Exceptions(JNTUH R13,MAY-16)


Ans: Checked exceptions that are checked at compile time. If some code within a method
throws a checked exception, then the method must either handle the exception or it must
specify the exception using throws keyword.
 ReflectiveOperationException
 ClassNotFoundException
 InstantiationException
 IllegalAccessException
 InvocationTargetException
 NoSuchFieldException
 NoSuchMethodException
 CloneNotSupportedException
 InterruptedException
Unchecked are the exceptions that are not checked at compiled time.
o ArithmeticException
o IndexOutOfBoundsException
o ArrayIndexOutOfBoundsException
o StringIndexOutOfBoundsException
o ArrayStoreException
o ClassCastException

7. What is Synchronization and why it is important(JNTUH DEC-17,R16)

Ans: Synchronization in java is the capability to control the access of multiple threads to any
shared resource.

Java Synchronization is better option where we want to allow only one thread to access the
shared resource.

Synchronization is used for


1. To prevent thread interference.
2. To prevent consistency problem.

8. How do we start and stop a thread(JNTUH MAY-18,R16)

43
Ans: As stop() method has been deprecated, interviewer will be interested in what logic you
will be using to stop a thread. There are two ways through which you can stop a thread in
java.
The easiest way to create a thread is to create a class that implements the Runnable interface.
To execute the run() method by a thread, pass an instance of MyClass to aThread in its
constructor

9. Write the complete life cycle of thread(JNTUH MAY-18,R16)


Ans: The java thread states are as follows:
1. New
2. Runnable
3. Running
4. Non-Runnable (Blocked)
5. Terminated
Life Cycle of a thread
1. New Thread: When a new thread is created, it is in the new state. The thread has not
yet started to run when thread is in this state. When a thread lies in the new state, it’s code
is yet to be run and hasn’t started to execute.
2. Runnable State: A thread that is ready to run is moved to runnable state. In this state,
a thread might actually be running or it might be ready run at any instant of time. It is the
responsibility of the thread scheduler to give the thread, time to run.
3. Blocked/Waiting state:When a thread is temporarily inactive, then it’s in one of the
following states:
 Blocked
 Waiting
4. Timed Waiting: A thread lies in timed waiting state when it calls a method with a time
out parameter. A thread lies in this state until the timeout is completed or until a
notification is received. For example, when a thread calls sleep or a conditional wait, it is
moved to a timed waiting state.
5. Terminated State: A thread terminates because of either of the following reasons:
Because it exists normally. This happens when the code of thread has entirely executed
by the program.

10. How do we set Priorities for threads(JNTUH MAY-18,R16)


Ans: Each thread have a priority. Priorities are represented by a number between 1 and 10. In
most cases, thread schedular schedules the threads according to their priority (known as
preemptive scheduling). But it is not guaranteed because it depends on JVM specification that
which scheduling it chooses.

3 constants defined in Thread class:

1. public static int MIN_PRIORITY


2. public static int NORM_PRIORITY
3. public static int MAX_PRIORITY
Default priority of a thread is 5 (NORM_PRIORITY). The value of MIN_PRIORITY is 1
and the value of MAX_PRIORITY is 10.

UNIT IV:

44
1. Compare byte streams with Character Stream( JNTUH,R15 DECEMBER-2018)
Ans: The main difference between Byte Stream and Character Stream in Java is that
the Byte Stream helps to perform input and output operations of 8-bit bytes while the
Character Stream helps to perform input and output operations of 16-bit Unicode.

2. List file access operations( JNTUH,R15 DECEMBER-2018)


Ans: The Files are created by the System. Means all the Files of an Operating System or
Window, are refers to Special Files. There are Many Types of SpecialFiles, System Files, or
windows Files, Input output Files. All the System Files are Stored into the System by using.
sys Extension.

3. What are the methods available in Character Stream(JNTUH, DEC-17 R16)


Ans: Methods of Reader class.

Methods Description
int read() This method reads a characters from the input stream.
int read(char[] This method reads a chunk of characters from the input stream and store them
ch) in its char array, ch.
This method closes this output stream and also frees any system resources
close()
connected with it.

Methods of Writer class.

Methods of Writer class provide support for writing characters to the output stream. As this is
an abstract class. Hence, some undefined abstract methods are defined in ths subclasses of
OutputStream.
Methods Description
abstract void This method flushes the output steam by forcing out buffered bytes to be
flush() written out.
void write(int c) This method writes a characters(contained in an int) to the output stream.
void write(char[]
This method writes a whole char array(arr) to the output stream.
arr)
abstract void This method closes this output stream and also frees any resources
close() connected with this output stream.

4. What types of streams does java define? ( JNTUH,R15 DECEMBER-2018)


Ans: There are two basic types of stream defined by Java, called byte stream and
character stream. The byte stream classes provide a convenient means for handling input
and output of bytes and character streams provide a convenient means for handling input and
output of characters, respectively.

5. What streams are used to read and write binary data? R15 DECEMBER-2018
Ans: To read and write 8-bit bytes, programs should use the byte streams, descendants
of InputStream and OutputStream. InputStream and OutputStream provide the API and partial
implementation for input streams (streams that read 8-bit bytes) and output streams (streams

45
that write 8-bit bytes). These streams are typically used to read and write binary data such as
images and sounds.

6. Write the syntax to create a random file ( JNTUH April/May -2018)


Ans:

Syntax Description

RandomAccessFile(File Creates a random access file stream to read from, and


file, String mode) optionally to write to, the file specified by the File
argument.

RandomAccessFile(String Creates a random access file stream to read from, and


name, String mode) optionally to write to, a file with the specified name.

7. What class is used to read characters from a file? Write the syntax? (JNTUH-May
2018)
Ans: Reader and Writer are the abstract super classes for character streams
in [Link]. Reader provides the API and partial implementation for readers--streams that read
16-bit characters--and Writer provides the API and partial implementation for writers--streams
that write 16-bit characters.
Syntax:
in = new FileReader("Filename");
out = new FileWriter("Filename");

8. What method is used to list the files in a directory? (JNTUH Dec 2018)
Ans: The list() method of the Java File class is used to list all the files and subdirectories
present inside a directory. It returns all the files and directories as a string array.

9. Write a program to compare two files? ( JNTUH,R15 DECEMBER-2018)


Ans:
import [Link];
import [Link];
import [Link];

46
public class CompareTextFiles
{
public static void main(String[] args) throws IOException
{
BufferedReader reader1 = new BufferedReader(new FileReader("C:\[Link]"));
BufferedReader reader2 = new BufferedReader(new FileReader("C:\[Link]"));
String line1 = [Link]();
String line2 = [Link]();
boolean areEqual = true;
int lineNum = 1;
while (line1 != null || line2 != null)
{
if(line1 == null || line2 == null)
{
areEqual = false;
break;
}
else if(! [Link](line2))
{
areEqual = false;
break;
}
line1 = [Link]();
line2 = [Link]();
lineNum++;
}
if(areEqual)
{
[Link]("Two files have same content.");
}
else
{
[Link]("Two files have different content. They differ at line "+lineNum);
[Link]("File1 has "+line1+" and File2 has "+line2+" at line "+lineNum);
}
[Link]();
[Link]();
}
}

10. What is the use of FileInputStream and FileOutputStream? (JNTUH,R15


DECEMBER-2018)
Ans: In Java, FileInputStream and FileOutputStream are byte streams that read and write
data in binary format, exactly 8-bit bytes. They are descended from the abstract classes
InputStream and OutputStream which are the super types of all byte streams.

47
FileInputStream

This class reads the data from a specific file (byte by byte). It is usually used to read the
contents of a file with raw bytes, such as images.

FileOutputStream

This writes data into a specific file or, file descriptor (byte by byte). It is usually used to write
the contents of a file with raw bytes, such as images.

UNIT V

1. What is the use of Layout Manager? (MAY-17,DEC-17 JNTUH R13)

Ans: The layout manager automatically positions all the components within the container.
Even if you do not use the layout manager, the components are still positioned by the default
layout manager. It is possible to lay out the controls by hand, however, it becomes very
difficult because of the following two reasons.

 It is very tedious to handle a large number of controls within the container.


 Usually, the width and height information of a component is not given when we
need to arrange them.
2. Give the hierarchy for swing components. (JNTUH DEC-17,R13)

3. What are the containers available in Swings? (JNTUH MAY-15,R13)


SWING Containers

Following is the list of commonly used containers while designed GUI using SWING.

48
S. No. Container & Description
Panel: JPanel is the simplest container. It provides space in which any other
1
component can be placed, including other panels.

2 Frame: A JFrame is a top-level window with a title and a border.

Window: A JWindow object is a top-level window with no borders and no


3
menubar.

4. Differentiate between Applet and Application. (JNTU MAY-16,MAY-15,R13)


Ans:
Applet Application
Small Program Large Program
Can be executed on stand alone computer
Used to run a program on client Browser
system
Applet is portable and can be executed by any Need JDK, JRE, JVM installed on client
JAVA supported browser. machine.
Applet applications are executed in a Application can access all the resources of
Restricted Environment the computer

5. What are the limitations of AWT? (JNTUH MAY-18,R16)


Ans: The AWT defines a basic set of controls, windows, and dialog boxes that support a
usable, but limited graphical interface. One reason for the limited nature of the AWT is that it
translates its various visual components into their corresponding, platform-specific
equivalents or peers. This means that the look and feel of a component is defined by the
platform, not by java. Because the AWT components use native code resources, they are
referred to as heavy weight. The use of native peers led to several problems. First, because of
variations between operating systems, a component might look, or even act, differently on
different platforms. This variability threatened java’s philosophy: write once, run anywhere.
Second, the look and feel of each component was fixed and could not be changed. Third, the
use of heavyweight components caused some frustrating restrictions.

6. Why do applet class need to be declared as public? (JNTUH MAY-18,R16)


Ans: Java requires that your applet subclass be declared public. Again, this is true only of
your main applet class; any helper classes you create do not necessarily need to be public.

7. What is Swing in Java? How it is differs from Applet? (JNTUH DEC-18,R16)


Ans: Swing is a GUI widget toolkit for Java. It is part of Oracle's Java Foundation
Classes (JFC) – an API for providing a graphical user interface(GUI) for Java programs.
Swing Applet

Swing is light weight Component. Applet is heavy weight Component.

Swing have look and feel according to user Applet Does not provide this facility.

49
view you can change look and feel using
UIManager.

Swing uses for stand lone Applications, Applet need HTML code for Run the Applet.
Swing have main method to execute the
program.

Swing uses MVC Model view Controller. Applet not.

Swing have its own Layout like most popular Applet uses AWT Layouts like flowlayout.
Box Layout.

Swing have some Thread rules. Applet doesn't have any rule.

To execute Swing no need any browser By To execute Applet programe we should need
which we can create stand alone application any one browser like Appletviewer, web
But Here we have to add container and browser. Because Applet using browser
maintain all action control with in frame container to run and all action control with in
container. browser container.

8. How do Java applets differ from Application programs (JNTUH DEC-18,R16)


Applet Application
Small Program Large Program
Used to run a program on client Browser Can be executed on stand alone computer system
Applet is portable and can be executed by any JAVA Need JDK, JRE, JVM installed on client
supported browser. machine.
Applet applications are executed in a Restricted Application can access all the resources of the
Environment computer
Applets are created by extending the Applications are created by writing public static
[Link] void main(String[] s) method.
Applet application has 5 methods which will be Application has a single start point which is
automatically invoked on occurance of specific event main method
Example:
import [Link].*;
import [Link].*;
public class Myclass extends Applet { public class MyClass
public void init() { } {
public void start() { } public static void main(String args[]) {}
public void stop() {} }
public void destroy() {}
public void paint(Graphics g) {}
}

9. List the types of containers. (JNTUH DEC-18,R16)


 Java EE server: The runtime portion of a Java EE product. A Java EE server provides
EJB and web containers.

50
 Enterprise JavaBeans (EJB) container: Manages the execution of enterprise beans for
Java EE applications. Enterprise beans and their container run on the Java EE server.
 Web container: Manages the execution of JSP page and servlet components for Java EE
applications. Web components and their container run on the Java EE server.
 Application client container: Manages the execution of application client components.
Application clients and their container run on the client.
 Applet container: Manages the execution of applets. Consists of a web browser and Java
Plug-in running on the client together.

10. Write a simple program for swing. (JNTUH MAY-18,R16)


Simple Java Swing Example:

import [Link].*;
public class FirstSwingExample {
public static void main(String[] args) {
JFrame f=new JFrame();//creating instance of JFrame
JButton b=new JButton("click");//creating instance of JButton
[Link](130,100,100, 40);//x axis, y axis, width, height
[Link](b);//adding button in JFrame
[Link](400,500);//400 width and 500 height
[Link](null);//using no layout managers
[Link](true);//making the frame visible
}
}

TUTORIAL CLASSES

S. No. Date Topic delivered Teaching AID HOD


Sign

Unit-1 OOP Concepts

1 OOP Concepts

2 Java Programming

3 Constructors, Overloading, Overriding

51
Unit-2 Inheritance

4 Inheritance Hierarchy

5 Polymorphism

6 Packages

Unit-3 Exception Handling

7 Exception Hierarchy

8 Try, Catch and Finally

9 Mutli-threading

Unit-4 Files & Database Connectivity

10 Files Streams

11 I/O Packages

12 JDBC Connectivity

13 Processing Queries

Unit-5 GUI Programming with Java

14 AWT

15 Swings

52
16 Applets

Guru Nanak Institutions Technical Campus


(Autonomous)
School of Engineering & Technology
Date: 07.05.2026
Assignment Questions
Name of the Subject : Object Oriented Programming through Java
Subject Code: 22PC0AD02

53
Class : II year -I Semester, [Link](CSE) –IOT
Name of the Faculty Member: [Link]

Unit – 1
2 Marks questions
1 Define Data Abstraction(JNTUH ,DEC-2017)
2 What is the size of char data type ? How does it differ from C language(JNTUH,DEC 2017)
3 Discuss the need for object oriented programming(GNITC AUTONOMOUS,DEC 2017)
4 Elucidate garbage collection in Java (GNITC AUTONOMOUS,DEC 2017)
5 What are the features of Java Language (MAY-17)
3 Marks questions
1 By what concept, unnecessary data can be hide?(MAY 2015)
2 List String Manipulation functions of java String class? (MAY 2015)
3 What is the use of Garbage collection in objects deletion?(MAY-2015)
4 How Recursion is implemented in Java? (MAY – 2017)
5 What is Anonymous Inner class(MAY-17)
5 Marks questions
1 What is a Constructor ? What are the special properties(GNITC AUTONOMOUS,DEC-
2017)
2 Demonstrate two dimensional arrays in Java with an example(GNITC AUTONOMOUS,
DEC 2017)
3 What feature of Java makes it platform independent and portable(JNTUH, DEC 2017)
4 Is Java a robust language ? Justify your answer(JNTUH, DEC 2017)
5 Differentiate between a class and object(JNTUH, DEC 2017)
Unit -2
2 Marks questions
1 How to define Package ? How to create user defined package(MAY-17,DEC-2017)

2 What is the use of anonymous inner class(JNTUH,DEC-2017)

3 Differentiate between a class and interface(GNITC AUTONOMOUS ,DEC-2017)

4 What are the benefits of inheritance (GNITC AUTONOMOUS ,DEC-2017)

5 How abstract class can be implemented and define Abstract class?(MAY-15)


3 Marks questions
1 With suitable example describe the usage the Super keyword?(MAY-16)
2 Differentiate between Interface and Abstract Class?(MAY-16,DEC-2017)
3 What are the different methods in Object class? (MAY – 16)
4 Program to demonstrate the working of Interface?(MAY – 15)

54
5 Define multiple inheritance. Does Java Support multiple inheritances. Justify Your answer
(MAY -15)
5 Marks questions
1 What is method overloading? Can you define two methods that have same name but different
parameter types ? can you define two methods in a class that have identical method names
and parameter profile with different return values types or different
modifier(GNITC,AUTONOMOUS,2017)
2 What is inheritance? Explain different forms of inheritance with suitable program segments
and real world example classes(JNTUH DEC-2017)
3 Program to demonstrate Constructor overloading ?(DEC-2017)
4 What is meant by Dynamic Method Dispatch(DEC-2017)
5 How the problem of Method Overriding will occur in program and define overriding
(MAY-15,GNITC AUTONOMOUS DEC-2017)
Unit -3
2 Marks questions
1 Differentiate between error and exception(JNTUH,DEC2017)
2 How to assign priorities to threads(JNTUH,DEC-2017)
3 How exception can be handled in java?(MAY-15)
4 List any six built-in Exceptions in java(MAY-15)
5 Difference between process and thread?(MAY-15,17, JNTUH DEC-2017)
3 Marks questions
1 How the thread is implemented in its lifecycle?(GNITC AUTONOMOUS 2017)
2 Define unchecked exception? List the types of unchecked exceptions?(MAY-16)
3 How multiple catch Statement will work (MAY-17)
4 What is meant by Re-throwing Exception Explain with example (MAY-15)
5 Explain with suitable examples about the usage of try and catch statements? (MAY 15)
5 Marks questions
1 Write a program to illustrate the use of multiple catch blocks for a try block(JNTUH,DEC-
17)
2 What are the uses of “throw and “throws” clause with example(JNTUH,DEC-2017)
3 Discuss about the thread priority with example?(MAY-15)
4 How consumer-producer problem can be solved?(MAY-15)
5 Explain the Synchronization among threads with example (MAY-17,JNTUH DEC 2017)
Unit -4
2 Marks questions
1 Compare byte streams with Character Stream( JNTUH,R15 DECEMBER-2018)
2 list file access operations( JNTUH,R15 DECEMBER-2018)
3 What streams are used to read and write binary data? R15 DECEMBER-2018
4 What class is used to read characters from a file? Write the syntax?(JNTUHMay 2018)
5 What method is used to list the files in a directory?(JNTUH Dec 2018)
3 Marks questions

55
1 What are the methods available in Character Stream(JNTUH, DEC-17 R16)
2 What types of streams does java define? ( JNTUH,R15 DECEMBER-2018)
3 Write the syntax to create a random file( JNTUH April/May -2018)
4 Write a program to compare two files?( JNTUH,R15 DECEMBER-2018)
5 What is the use of FileInputStream and FileOutputStream? JNTUH,R15 DECEMBER-2018)
5 Marks questions
1 What are the methods available in the Character Stream(JNTUH DEC-18,R16)
2 Distinguish between Byte Stream and Character Stream Classes( JNTUH DEC-18,R16)
3 Explain the types of drivers used in JDBC(JNTUH MAY-16,R13)
4 What is JDBC? Explain the role & responsibility of JDBC API.(Gnitc Dec 2019)
5 What is Driver Manager Class? Explain the types of JDBC Driver with suitable
diagram.(GNITC DEC 2019)
Unit -5
2 Marks questions
1 Give the hierarchy for swing components(JNTUH DEC2017)
2 What are the limitations of AWT over Swings?(NOV-16,JNTUH DEC 2017)
3 What is the difference application and applet?(MAY-15)
4 What is an Applet?(JUNE - 14)
5 Difference between AWT and Swings?(MAY-15)
3 Marks questions
1 Explain the life cycle of an applet?(MAY-16,17)
2 AWT Class Hierarchy (MAY-15)
3 Explain how to pass the parameters to applets?
4 What are the applet security issues?
5 What are the methods of applets(JUNE-14)
5 Marks questions
1 What are the different Swing components Explain(MAY-17)
2 List out various Swing containers and explain them clearly(MAY-15)
3 Write a Java program for develop simple calculator using Swings. (MAY-15)
4 Discuss about various methods defined in the following classes:a. JLabel b. JTextField
c. JButton d. JTextArea?(MAY-16,17)
5 Explain the usage of JFrame with example and explain about check box, Combo box,
Radiobutton ?(MAY-16,17)

Remedial / Corrective Action:

56
Date Topics Covered Number of Students Attended Teaching
IOT

57

You might also like