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

JAVA Qy

This document is a comprehensive question bank for Java, covering various topics such as basic syntax, inheritance, exception handling, event handling, and network programming. It includes questions categorized by marks, providing a structured approach for students to study and prepare for exams. Additionally, it promotes a community for diploma students through Campusify.college.
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)
4 views

JAVA Qy

This document is a comprehensive question bank for Java, covering various topics such as basic syntax, inheritance, exception handling, event handling, and network programming. It includes questions categorized by marks, providing a structured approach for students to study and prepare for exams. Additionally, it promotes a community for diploma students through Campusify.college.
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
You are on page 1/ 7

JAVA

QUESTION BANK

This Study Material is provided by Campusify.college ©


We have wide range of study materials of Diploma and Engineering,

#We are building Biggest Community of Diploma Students and if you


want to be a part of it for multiple benefits then join our community by
following links.

Our Site - https://www.campusify.college


Join Telegram Channel - https://t.me/campusifyy
Join Whatsapp Grp- https://tinyurl.com/wpjoinlink1

Downloaded from Campusify


Question Bank

Chapter 1: Basic syntactical constructs in java (12 marks)


2 Marks
1 Write all primitive data types available in java with their storage size in bytes
2 Write down the syntax of array declaration, initialization.
3 Define term token and enlist types of tokens in java
4 Write syntax and example for-each.
5 Explain the difference between String and StringBuffer.
6 Describe instanceOf and dot (.) operators in Java with suitable example.
7 Enlist any two bitwise and logical operators.
8 What is Object? How to create it? Explain with Example.
4 Marks
1 Explain any four features of java.
2 Write a program to accept marks and find grade using if statement.
3 Describe concept of type casting and explain its types with proper syntax and example.
4 State & explain scope of variable with an example.
5 Write a program to accept a character and check whether a character is vowel or
consonant using switch-case statement.
6 Write a program to copy all elements of one array into another array.
7 What is method overloading and constructor overloading? Give examples.
8 Explain the significance of garbage collection in Java. How does it contribute to memory
management?
9 Write a program to print all the Armstrong numbers from 0 to 999.
10 Explain visibility controls in Java.
11 Compare Array and Vector.
12 Write a program to check the entered string is palindrome or not?

6 Marks
1. Describe the use of any methods of vector class with their syntax.
2. Explain the command line arguments with suitable example.
3. Write a program to print the sum, difference and product of two complex numbers by
creating a class named “Complex” with separate methods for each operation whose real
and imaginary parts are entered by user.
4. What is constructor? List types of constructors. Explain parameterized constructor with
suitable example.
5. Explain vector with the help of example. Explain any 4 methods of vector class.

Downloaded from Campusify


Chapter 2: Inheritance, Interface and Package (12 marks)

2 Marks
1. Define inheritance. List types of Inheritance with suitable Example.
2. List the Uses of keywords 1. final 2. this 3. super
3. List any four built in packages in java.
4. Describe concept of package and its syntax.
5. Define syntax of abstract class and method.

4 Marks
1. Write the three uses of final keyword with suitable example
2. What is Interface? Describe syntax, feature & need of an interface
3. Write a single program to implement inheritance and polymorphism in java.
4. Develop a program to find area of rectangle and circle using interfaces.
5. Explain how to create a package and import it with suitable example.
6. Differentiate between method overloading and method overriding.
7. Describe concept of multiple inheritances? Write a java program to implement multiple
inheritance
8. Develop a program to implement the multilevel inheritance.
9. Explain method overriding with suitable example.

6 Marks
1. Develop an Interest Interface which contains simple interest and compound interest
methods and static final field of rate25%. Write a class to implement those methods.
2. Write a program to implement following inheritance.

3. Write a program to implement following inheritance.

Interface: Class: Employee


Salary name, age
basic_sal display()

Class: Employee
name,Downloaded
age from Campusify
display()
Unit 3- Exception Handling and Multithreading (12 marks)

2 Marks
1. Define concept of Exception?
2. Enlist any four-compile time error.
3. Define thread. Mention two ways to create thread.
4. Write steps to create a thread using Runnable interface.
5. Describe thread priority.
6. Describe use of throws with syntax and example.
7. Define the term: i. Thread ii. Exception

4 Marks
1. Explain the following clause in exception handling.
a. try b) catch c) throw d) finally
2. Describe the life cycle of thread with suitable example
3. Write a program to create user defined exception in java.
4. Write a java program in which Thread A will display the even number between 1 to
50 and thread B will display the odd numbers between 1 to 50. After 3rd iteration
thread A should go to sleep for 500ms.
5. Differentiate between throw and throws
6. Differentiate between Multithreading and Multitasking.

6 Marks
1. Develop a program to accept a password from the user and throw “Authentication
Failure”
2. Write a program to create two thread one to print odd number only and other to print
even numbers.
3. Define an Exception called “NotMatchException” that is thrown when a password is
not equal to “MSBTE”. Write the program.

Downloaded from Campusify


UT 2- Question Bank

UNIT 4 –Event handling using Abstract Window Toolkit (AWT) & Swings Components

1. What is frame in swing. how to create frame.


2. What is panel ? How to create with example.
3. Name Different Layout manager.
4. Define Container list any 4 type of container
5. Name the package which is used to design AWT control.
6. List the different types of Listeners.
7. List method of KeyListener with syntax.
8. Name method of MouseListener with syntax
9. Name method of MouseMotionListener with syntax
10. Name method of ItemListener , ActionListener with syntax
11. Name method of TextListener with syntax
12. Name the package which is used to design AWT control and swing.
13. Define Event, source and Listener

4 Mark Question
1. Design an application to create from using Textfield, textarea,Button and Lable.
2. WAP to create three Button with Caption, OK, RESET and Cancel.
3. Explain feature of swing.
4. Write a program to demonstrate the use of keyEvent when key is pressed and display
“keypressed” message.
5. Write a program to display The Number on Button from 0 to 9 using FlowLayout.
6. Write a program to generate following output

7. Explain Delegation Event Model

8. WAP which create a menubar with different colour.

9. Write a program to demonstrate ActionListener Interface.

Downloaded from Campusify


10. Write a program using JTextField to perform the addition of two numbers

11. Write a program to demonstrate the use of mouseDragged and mouseMoved method of
MouseMotionListener

12. Write a java program to create a table of name of Student ,Percentage and Grade of 5 Student using
JTable.

13. Develop an application using List components to add names of 10 different cities.

14. Design an application to demonstrate the use of Radio Button and Checkbox using swing

15. Write a program to generate following output using Border Layout

16. Write JTree program to show following output.

17. Write a program which create Progress bar Vertically.

18 Differences between SWING and AWT.


19. Write a program to create Combo Box

UNIT 5- BASICS OF NETWORK PROGRAMMING

Downloaded from Campusify


2 Marks
1. 1. What is networking? write its advantage and disadvantage
2. Define Socket and ServerSocket class.
3. Write the use of getByName() and getAllByName() method

4. Write the function of Connect(), Bind()


5. Name the package in which URL class is defined
6. Write the use of openConnection() method of URLConnection class.

4 Marks

1. Write a program using URL class to retrieve the host, protocol, port and file of URL
http://www.msbte.org.in
2. Develop a program using InetAddress class to retrieve IP address of computer
when hostname is entered by the user.
3. Write the difference between SeverSocket and DatagramPacket

4. Explain URL class with example.


5. Explain URLConnection class method(any 4)
6. Explain URL class Constructor (any 4)
7. Explain Factory method of InetAddress class
8. Explain Instance Method s of InetAddress class.

9. Write a program using Socket and ServerSocket to create Chat Application

UNIT 5- BASICS OF NETWORK PROGRAMMING

2 Marks
1. Name the Types of drivers for data base connectivity.
2. Write the use of Class .forName()
3. List Advantages JDBC over ODBC.
4. Write Advantages and disadvantages of Statements And Prepared Statement
5. List steps for database connectivity
6. Differentiate between Statement and Prepared Statement Interface
4 Marks
1. Write program to Create a student table in database and insert a record in student table
2. Write program to update record in database.
3. Write program to implement delete statement.
4. Develop JDBC program to Retrieve Data from table using resultset interface.
5 .Explain Types of ResultSet
6 Explain the methods of ResultSet Interface
7 Explain with neat diagram of JDBC architecture.
8 Explain Two tier Model of JDBC Architecture
9 Explain JDBC drivers.
Downloaded from Campusify

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy