Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
5 views

Java

The document outlines a comprehensive set of Java programming tasks and concepts across multiple modules, including bitwise operators, control statements, variable scopes, method overloading, inheritance, exception handling, and threading. Each module contains specific questions or programming exercises that aim to deepen understanding of Java's features and functionalities. The content is structured to cover fundamental and advanced topics in Java programming, suitable for learners at different levels.

Uploaded by

manishsahani.edu
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Java

The document outlines a comprehensive set of Java programming tasks and concepts across multiple modules, including bitwise operators, control statements, variable scopes, method overloading, inheritance, exception handling, and threading. Each module contains specific questions or programming exercises that aim to deepen understanding of Java's features and functionalities. The content is structured to cover fundamental and advanced topics in Java programming, suitable for learners at different levels.

Uploaded by

manishsahani.edu
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

M1

1. Explain the various bitwise and short-circuit operators in Java. Differentiate


two paradigms of programming.
2. Explain 4 different types of if statements in Java with examples. Demonstrate
working of break with labels in Java.
3. Explain various scopes of variables in Java. Explain the arithmetic compound
assignment and Ternary operators in Java.
4. Write a Java program to perform linear search on an array elements accepted from
keyboard and key element also accepted from keyboard.
5. Write a Java program with a method to check whether a given number is prime or
not.
6. Discuss the different data types supported by Java along with the default values
and literals.
7. Justify the statement "Compile once and run anywhere" in Java.
8. Briefly explain the various primitive data types used in Java.
9. List the various operators supported by Java. Illustrate the working of >> and
>>> operators with an example.
10. Write a Java program to add two matrices with arguments.

M2
1. What is method overloading? Illustrate the concept of method overloading using a
Java program.
2. Explain the role of "this" keyword and "static" keyword in Java.
3. Examine Java Garbage collection mechanism by classifying the 3 generations of
Java heap.
4. Define recursion. Write a recursive program to find the nth Fibonacci number.
5. Interpret the general form of a class. Explain call by value and call by
reference with examples.
6. Write a Java program to illustrate: (i) Passing object as parameters. (ii)
Returning objects.
7. Explain the constructor method and parameterized constructors methods with
suitable examples.
8. Develop a Java program to find the area of a rectangle, area of a circle, and
area of a triangle using the method overloading concept.

M3
1. Define inheritance and list the different types of inheritance in Java.
2. Explain the role of "Super" with an example Java program.
3. For any class and any method as an example, explain method overriding.
4. Explain the order of constructor execution in a multilevel class hierarchy.
5. Define dynamic method dispatch and write a code snippet in Java to demonstrate.
6. Briefly explain the final polymorphism concepts.
7. Define an interface. Briefly explain the general forms of an interface.
8. Discuss the significance of nested interfaces in Java.
9. Build a Java program to create a class named 'Shape'. Create 3 subclasses namely
circle, triangle, and square; each class has 2 methods named draw() and erase().
Demonstrate polymorphism concepts by developing suitable methods and main program.
10. Develop a Java program to create an interface Resizable with methods
resizeWidth(int width) and resizeHeight(int height) that allow objects to be
resized. Create a class Rectangle that implements this interface.

M4
1. Explain four categories of visibility for class members based on packages.
2. Give the general form of an exception handling block and write a Java program to
illustrate multiple catch classes.
3. Examine the various levels of access protections available for packages and
their implications with suitable examples.
4. With code snippets, explain the mechanism to create and import a package in
Java.
5. Write a Java program to create custom exception for Negative odd numbers.
6. Define Exception. Explain Exception handling mechanism provided in Java along
with syntax and example.
7. Enlist any three Java Built-in exceptions and explain. What is a chained
exception? Give an example that illustrates the mechanics of handling chained
exceptions.
8. What is a package? What are the steps involved in creating user-defined
packages? Explain.
9. Write a program to illustrate nested if statements.
10. Write a Java program to create chained exceptions with top-level exception is
Null Pointer Exception and its cause Arithmetic Exception.

M5
1. Explain various methods of the Thread class in Java. Write a program to create
multiple threads in Java.
2. Explain the use of Type wrappers in Java with examples. List and discuss the
Numeric type wrappers methods.
3. Explain the isAlive() and join() methods of Thread with example code snippets.
4. Explain the concept of autoboxing/unboxing in expressions and methods.
5. Write a Java program to create chained exceptions with the top-level exception
being a Null Pointer Exception and its cause being an Arithmetic Exception.
6. Define a thread. Also, discuss the different ways of creating a thread.
7. How can synchronization be achieved between threads in Java? Explain with an
example.
8. Discuss the significance of thread priorities in Java.
9. Write a Java program to create 4 threads, and each thread, when run, will sleep
for 500 milliseconds and print its name before "Before Quitting".
10. Write a Java program to demonstrate the use of the synchronized keyword.

You might also like