Anda di halaman 1dari 2

JAVA PROGRAMMING - MID 1 QUESTION BANK

UNIT-1
PART-A
1) Support the statement “java byte code gives high performance”.
2) Compare inheritance with polymorphism
3) Differentiate between abstraction and information hiding.
4) Illustrate type casting in java with an example.

PART-B
1. a) What are the problems with procedure languages? How object oriented languages overcomes the
problems of procedural languages?
b) List and explain the applications of OOPs.
2. What are java Buzzwords? Explain about them.
3. a) Discuss the principles of object oriented languages in detail.
b) What is the role and responsibility of JVM in program execution?
4. a) Explain Primitive type conversion and casting with examples.
b) Explain precedence rules and associativity concept
5. a) Discuss the lexical issues of Java.
b) Illustrate the usage of jump statements in Java with example.

PROGRAMS:
1) Write java program using ternary operator to find maximum of three numbers.
2) Write a Java program to generate a pyramid of numbers for given number N using for loop.
3) Write a Java program to interchange the rows and columns of a given matrix.
4) Write a Java program to find the sum of the squares of the diagonal elements of a square matrix.
5) Write a Java program to sort a given set of strings in the alphabetical order where the strings are
supplied through the command line.
6) Write a java program to simulate the operation of numerical calculator to perform the functions
Addition (+), Subtraction (-), Multiplication (*) and Division (/).

UNIT-2
PART-A
a) How garbage collector plays its role? Explain.
b) What is an Object? How to allocate memory for objects?
c) List out the characteristics of the static method.
d) What is a constructor? When does the compiler supply default constructor for a class?
e) Differentiate between array and vector with examples.

PART-B
1. a) How to share the data among the functions with the help of static keyword? Give example.
b) Discuss about inner classes.
2. a) What is an array? How arrays are declared and initialized? Explain with examples.
b) What is a constructor? What is its requirement in programming? Explain with program.
3. a) What do you mean by static class and static method? Explain with example.
b) Why do constructors does not have any return type? Explain it with proper example.
4. a) How to overload methods in Java? Explain the concept of ‘Using objects as parameters to methods.
b) Explain “this” Key word with good example.

PROGRAMS:
1) Write a program to perform the following functions using classes, objects, constructors and
destructors wherever necessary
i) Read 5 subject's marks of 5 students
ii) Calculate the total and print the result on the screen
2) Write a java program to illustrate "Constructor Overloading".
3) With a program illustrate the use of command line arguments.

UNIT-3
PART-A
1) Why to use finally block in java exception handling.
2) How java supports multiple inheritance?
3) Differentiate class, abstract class and interface.
4) How to create and use a package in Java program?

PART-B
1. a) How to create packages and use them in java?
b) What is an exception? Explain exception handling in java with examples.
2. a) Differentiate method overloading with method overriding with examples.
b) What is interface? How to create it and access it? Explain with example.
3. a) With suitable code segments illustrate various uses of ‘final’ keyword.
b) How to define a user exception in a program? Illustrate with an example.
4.a) Explain various forms of inheritance with suitable code segments.
b) What is the importance of abstract classes? Show it with an example.

PROGRAMS:
1) Write an example program to show the calling sequence of constructors.
2) Write a program to implement multiple inheritances.
3) Write a Java program to find the area and perimeter of square and circle using interface
4) Write a program to illustrate the usage of try and catch blocks in Java.

Anda mungkin juga menyukai