Java Sorted Question
Java Sorted Question
1.1 Java Features and the Java Programming Environment, Object Oriented,
Compiled, Interpreted, Platform independent, Portable, Robust and Secure,
Dynamic.
1.3 Java Tokens and Data types, Constants and Symbolic Constants, variables,
dynamic initialization, data types, array and string, scope of variable, typecasting,
and standard default values.
• Define type casting. Explain its types with syntax and example. (Winter 19)
• Describe type casting in java with example. (Summer 23)
• Explain implicit and explicit type conversion with example in detail. (Winter
23)
• Write a program to display ASCII value of a number. (Winter 23)
• Define array. List its types. (Winter 19)
• Define array. List its types. (Summer 24)
• Write down the syntax of array declaration, initialization. (Winter 23)
1.4 Operators and Expressions, Arithmetic Operators. Relational Operators, Logical
Operators, Increment and Decrement, Conditional Operators, Bit wise Operators,
Instance of Operators, Dot Operators, Operator precedence and associativity,
Evaluation of Expressions, Type conversions in expressions, Mathematical
Functions - min(),max), sqrt), pow), exp(), round(), abs).
• State any four relational operators and their use. (Winter 22)
• Enlist the logical operators in Java. (Summer 22)
• Enlist any two logical operators and two bitwise operators. (Winter 23)
• Explain any two logical operators in Java with example. (Winter 19)
• Describe instance Of and dot ( ) operators in Java with suitable example.
(Summer 19)
• Give the syntax and example for the following functions (Summer 22)
▪ min ()
▪ Sqrt ()
• Write a program using sqrt() and pow() to calculate the square root and power
of given number. (Winter 24)
• Write a program to accept four numbers from user using command line
arguments and print the smallest number. (Winter 24)
• Write a program to demonstrate the use of conditional operator and switch
case statement. (Winter 24)
1.5 Decision making and looping: If statement, if else statement, nested if else
statement, if else if ladder, the switch statement, nested switch statement, The
?:operator, The while statement, the Do while statement, the 'for' statement, break,
continue and return statement, nested loops, labeled loops, for-each version of the
for loop.
• Explain switch case and conditional operator in java with suitable example.
(Summer 22)
• Write a Jav a program to find out the even numbers from 1 to 100 using for
loop. (Summer 22)
• Write a program to check whether the given number is prime or not. (Winter
22)
• Write a program to find reverse of a number. (Winter 22)
• Write a program to print all the Armstrong numbers from 0 to 999. (Summer
23)
• Write a program to print all the Armstrong numbers from 0 to 999. (Summer
23)
Unit 3: Inheritance
• 3.1 Inheritance: concept of inheritance Types of Inheritance
o List the types of inheritances in Java. (Summer 19)
o List the types of inheritance which is supported by java. (Winter 22)
o Explain single and multilevel inheritance with proper example. (Summer 22)
• 3.2 Single Inheritance. multilevel Inheritance. Hierarchical Inheritance. method
and constructor overloading and overriding. dynamic method dispatch, final
variables, final methods. use of super. abstract methods and classes. static
members.
o Differentiate between method overloading and method overriding. (Summer
19)
o Differentiate between method overloading and method overriding. (Winter 23)
o Explain dynamic method dispatch in Java with suitable example. (Summer 19)
o Explain the concept of Dynamic method dispatch with suitable example.
(Summer 19)
o Explain dynamic method dispatch mechanism with suitable example. (Winter
24)
o State the use of final keyword with respect to inheritance. (Winter 22)
o Write the use of 'Final' key word with suitable example. (Winter 24)
o Implement the following inheritance. (Winter 19)
▪ Interface: Salary
▪ Basic...
o Develop a program to create a class 'Book' having data members 'author', 'title'
and 'price'. Derive a class 'BookInfo' having data member 'stockposition' and
method to initialize and display the information for three objects. (Winter 22)
o Write a program to implement the following inheritance. Refer Fig. No. 1.
(Summer 23)
▪ Interface: Exam
▪ Sports mark = 20;
▪ Class: Student
▪ Roll no, S-name
▪ m1, m2, m3
▪ Class: Result
▪ display ()
o Implement the following inheritance. Refer Fig. No. 01. (Summer 24)
▪ Interface: Salary
▪ class: Employee
▪ Basic-Salary
▪ Basic-Sall()
▪ Name, age
▪ Display()
▪ Class: Gross - Salary
▪ TA
▪ DA, HRA
▪ Total-Sal()
• 3.3 Interfaces: Define Interface, implementing interface, accessing interface,
variables and methods. extending interfaces, interface references, nested
interfaces
o Define the interface in Java. (Summer 22)
o Define interface in java with suitable example. (Summer 23)
o Define the interface in Java. Write the syntax. (Summer 24)
o Differentiate between class and interfaces. (Winter 19)
o Define Packages. How to create user defined package? Explain with example.
(Winter 19)
o How to create user defined package in Java. Explain with an suitable example.
(Summer 22)
o Give a syntax to create a package and accessing package in java (Summer 23)
o Explain how to create a package and how to import it. (Summer 22)
o Describe the package in java with suitable example. (Summer 23)
o Explain how to create a package and import it with suitable example. (Winter
24)
• 4.1 Errors and Exception :Types of errors, exceptions, try and catch statement,
nested try statement, throws and Finally statement, build-in exceptions, chained
exceptions, creating own exception(throw clause), subclasses.
o Define error. List types of error. (Winter 19)
o Enlist any four compile time errors. (Summer 22)
o Explain exception handling mechanism. w.r.t. try, catch, throw and finally.
(Summer 22)
o Define exception. State built-in exceptions. (Winter 19)
o Write a program to create a user defined exception in java. (Summer 23)
o Define an exception called 'No Match Exception' that is thrown when the
password accepted is not equal to 'MSBTE'. Write the program. (Winter 22)
o Write a program that throws an exception called "NoMatchException" when a
string is not equal to "India". (Winter 23)
o Define exception called 'No Match Exception' that is thrown when the
password accepted is not equal to 'MSBTE'. Write the program. (Summer 24)
o Write a program to create user defined exception "MIN-BAL". Throw the
exception when balance in account is below 500 rupees. (Winter 24)
o i) Explain Errors and its types in detail. (Winter 23)
• 4.2 Multithreaded Programming Creating a Thread: By extending to thread
class and by implementing runnable Interface. Life cycle of thread: Thread
Methods: wait, sleep), notify), resume(), suspend), stop().Thread exceptions.
thread priority and methods, synchronization, inter-thread communication.
deadlock.
o Explain the two ways of creating threads in Java. (Summer 19)
o Define thread. Mention 2 ways to create thread. (Winter 22)
o Define Thread. Draw life cycle of Thread. (Winter 23)
o Explain life cycle of thread. (Winter 19)
o Describe Life cycle of thread with suitable diagram. (Winter 22)
o Explain the applet life cycle with neat diagram. (Summer 23)
o Explain thread life cycle with neat diagram. (Summer 23)
o Draw and explain life cycle of Thread. (Summer 22)
o Draw and explain life cycle of thread. (Winter 24)
o Give a syntax of following thread method (Summer 23)
▪ i) Notify()
▪ ii) Sleep()
o Write a program to create two threads. One thread will display the numbers
from 1 to 50 (ascending order) and other thread will display numbers from 50
to 1 (descending order). (Summer 19)
o Write a program to create two threads one thread will print even no. between 1
to 50 and other will print odd number between 1 to 50. (Winter 19)
o Write a Java program in which thread A will display the even numbers
between 1 to 50 and thread B will display the odd numbers between 1 to 50.
After 3 iterations thread A should go to sleep for 500 ms. (Summer 22)
o Write a program to print even and odd number using two threads with delay of
1000ms after each number. (Summer 23)
o Write a program to create two threads. One thread will display the odd
numbers from 1 to 50 and the other thread will display the even numbers.
(Winter 24)
o Define thread priority ? Write default priority values and the methods to set
and change them. (Winter 22)
o ii) Explain thread methods to set and get priority. (Winter 23)
o Differentiate between starting thread with run() method and start() method.
(Winter 23)
• 5.1 Introduction to applets: Applet, Applet life cycle (skeleton), Applet tag,
Adding Applet to HTML file. passing parameter to applet, embedding < applet>
tags in java code, adding controls to applets.
o Give the syntax of < param tag to pass parameters to an applet. (Summer 19)
o Give a syntax of (param) tag to pass parameters to an applet. (Summer 23)
o Give the use of <PARAM> tag in applet. (Summer 24)
o Write a program to accept username in the form of parameter and print "Hello
<username>". (Winter 19)
o Mention the steps to add applet to HTML file. Give sample code. (Winter 22)
o Explain applet life cycle. (Winter 19)
o Explain the applet life cycle with neat diagram. (Summer 23)
o Explain Applet life cycle in detail. (Winter 23)
o Explain Life Cycle of the applet with neat diagram. (Summer 24)
o Explain life cycle of an Applet with suitable example. (Winter 24)
o State the classes that can an applet extend. (Winter 23)
• **5.2 Graphics Programming: Graphics classes, lines, rectangles, ellipse, circle, arcs.
polygons, color and fonts, setColor(), getColor(), setForeGround(), setBack