OOP-I Exam Preparation
Full explanation, worked examples & memory tricks in the app
Shared by a Veda learner · Generated with Veda AI
Full explanation, worked examples & memory tricks in the app
Every question in the paper gets a full exam-length answer in the app — organised by marks, the way a topper writes it.
Write a java program to sum first n natural numbers.
Use a loop to iterate from 1 to n and sum the numbers.
The full exam-length answer is in the app.
With the help of example explain use of break and continue in java.
Break exits the loop; Continue skips the current iteration.
The full exam-length answer is in the app.
Write a code segment to get input from keyboard in java. Import all necessary packages.
Use Scanner class from java.util package.
The full exam-length answer is in the app.
Write a java program for adding two 2x2 matrix.
Use nested loops to sum corresponding elements.
The full exam-length answer is in the app.
Write a java program to sort an array of five integer in descending order.
Use Arrays.sort() in reverse order.
The full exam-length answer is in the app.
List various classes of java.io package used for Text IO.
BufferedReader, FileReader, PrintWriter.
The full exam-length answer is in the app.
List various classes of java.io package used for Binary IO.
FileInputStream, FileOutputStream, ObjectInputStream.
The full exam-length answer is in the app.
Draw and explain life cycle of Thread.
Thread lifecycle includes New, Runnable, Blocked, Waiting, Timed Waiting, and Terminated states.
The full exam-length answer is in the app.
Show the two methods which are used to create a thread in Java.
Extending Thread class and implementing Runnable interface.
The full exam-length answer is in the app.
Explain the syntax of loops in java.
Loops in Java include for, while, and do-while with specific syntax for each.
The full exam-length answer is in the app.
Write java syntax to create array with five integers. (use array initialization)
int[] arr = {1, 2, 3, 4, 5};
The full exam-length answer is in the app.
Write a java syntax to create a two dimensional array with 3 row and 3 columns. Also initialize the array.
int[][] arr = {{1,2,3}, {4,5,6}, {7,8,9}};
The full exam-length answer is in the app.
Define exception. Explain throw and throws.
An exception is an event that disrupts normal program flow; 'throw' creates an exception, 'throws' declares it.
The full exam-length answer is in the app.
With the help of example explain the priority queue in java.
PriorityQueue orders elements based on priority; example: storing tasks with different priorities.
The full exam-length answer is in the app.
List various static methods of List.
Methods include 'of()', 'copyOf()', 'fill()', 'sort()'.
The full exam-length answer is in the app.
Define Object, Class and Instance
Object is an instance of a class; Class is a blueprint for creating objects; Instance is a specific realization of a class.
The full exam-length answer is in the app.
List any four features of Object oriented programming language.
Encapsulation, Inheritance, Polymorphism, Abstraction.
The full exam-length answer is in the app.
List and explain any three category of operator in java.
Arithmetic, Relational, and Logical operators.
The full exam-length answer is in the app.
Explain abstract method using example.
An abstract method has no body and must be implemented in derived classes.
The full exam-length answer is in the app.
Explain abstract class with the help of example.
An abstract class cannot be instantiated and may contain abstract methods.
The full exam-length answer is in the app.
Compare run time and compile time exception.
Compile-time exceptions are checked at compile time; run-time exceptions occur during execution.
The full exam-length answer is in the app.
List various UI Controls in javaFX.
Button, Label, TextField, and ComboBox.
The full exam-length answer is in the app.
With the help of example explain handling events in javaFX.
Event handling in JavaFX involves using EventHandlers to respond to user actions.
The full exam-length answer is in the app.
Compare Set and List in java.
Set does not allow duplicates; List allows duplicates and maintains order.
The full exam-length answer is in the app.
Compare Vector and Stack.
Vector is synchronized; Stack is a subclass of Vector with LIFO behavior.
The full exam-length answer is in the app.
The full Veda Bites deck, complete notes, spaced-repetition flashcards, leveled MCQs, tests and games for this kit — plus Daily Facts and the Arena, every day.