1. What is procedure-oriented programming?
A programming paradigm based on the concept of procedures or routines, where the program is divided in
2. Define an object.
An object is an instance of a class that contains both data (attributes) and methods (functions) to manipula
3. Define a software object.
A software object is a self-contained unit consisting of data and procedures that operate on the data, creat
4. What is object-oriented programming?
Object-Oriented Programming (OOP) is a paradigm that organizes software design around objects, which
5. What is the difference between procedure-oriented programming and object-oriented programming?
POP focuses on functions and procedures, while OOP focuses on objects and classes. OOP provides bett
6. What is the use of data hiding?
Data hiding protects data from unauthorized access and ensures only essential details are exposed, enhan
7. What is abstraction?
Abstraction is the process of hiding complex implementation details and showing only essential features to
8. What is encapsulation?
Encapsulation is the concept of wrapping data and the methods that operate on the data into a single unit (
9. What is the difference between abstraction and encapsulation?
Abstraction hides complexity by showing only essential information; encapsulation hides the internal state
10. What is the benefit of encapsulation?
Encapsulation enhances security, modularity, and maintainability by restricting direct access to some comp
11. What is a function?
A function is a block of code that performs a specific task and can be reused throughout a program.
12. What is the role of a function in encapsulation?
Functions provide controlled access to data members of a class, supporting encapsulation by defining how
13. What is OOP?
OOP (Object-Oriented Programming) is a programming model based on objects that encapsulate data and
14. What are the elements of OOP?
The main elements are: Classes, Objects, Inheritance, Polymorphism, Abstraction, and Encapsulation.
15. What are the features of Java language?
Simple, Object-oriented, Platform-independent, Secure, Robust, Portable, High performance, Multithreade
16. What is Java Development Kit?
Java Development Kit (JDK) is a software development environment used to develop Java applications an
17. What is Java Virtual Machine?
JVM is a virtual machine that runs Java bytecode and provides a platform-independent execution environm
18. What is BlueJ or Greenfoot?
BlueJ and Greenfoot are educational IDEs for learning Java. BlueJ is for general-purpose Java developme
19. What are the features of BlueJ or Greenfoot?
Simple interface, Easy-to-use for beginners, Interactive object creation, Visualization of class structure, Su
20. Write a brief program in BlueJ environment and compile it.
public class Hello {
public static void main(String[] args) {
System.out.println("Hello, BlueJ!");
}
}
21. Write the steps of creating a class in BlueJ.
1. Open BlueJ
2. Create a new project
3. Click 'New Class'
4. Enter class name
5. Click OK to create the class
22. Write the steps of running a program in BlueJ.
1. Compile the class
2. Right-click the class
3. Select 'void main(String[] args)'
4. Click OK to execute
23. How can you create a JAR file?
In BlueJ: Go to Project > Create JAR File, select classes and settings, then click 'Continue' to generate the
24. Define the following in terms of Java:■(i) Robustness■(ii) Portability■(iii) JVM■(iv) Platform independe
(i) Robustness: Java has strong memory management and exception handling to create reliable programs.
(ii) Portability: Java programs can run on any device with a JVM, making them portable.
(iii) JVM: Java Virtual Machine runs Java bytecode and provides a platform-independent execution environ
(iv) Platform Independent: Java code is compiled into bytecode which can be run on any system with a JVM