Unit summary
- OOP organises programs as objects that join data and methods, using classes, abstraction, encapsulation, inheritance and polymorphism.
- OOP gives reusability, data security and easy maintenance, and is used in GUIs, games, simulations and databases.
- Java was created at Sun Microsystems by James Gosling and released in 1995.
- Java is simple, object-oriented, platform independent, robust, secure, multithreaded and distributed.
- Java compiles to bytecode that runs on the JVM, with the JDK providing javac and java.
- A Java program has classes and a main method, uses comments and Math functions, and is built from tokens and statements.
- Command-line arguments are received in String[] args and converted as needed.
Glossary
| Term | Meaning |
|---|---|
| Abstraction | Showing only essential features. |
| Bytecode | The JVM's platform-independent instructions. |
| Class | A blueprint for objects. |
| Command-line argument | A value passed to main when the program starts. |
| Dynamic binding | Choosing the method to run at run time. |
| Encapsulation | Wrapping data and methods together with data hidden. |
| Garbage collection | Automatic freeing of unused objects. |
| Identifier | A name for a class, method or variable. |
| Inheritance | Acquiring properties of an existing class. |
| JDK | The Java Development Kit. |
| JIT compiler | Converts bytecode to native code at run time. |
| JRE | The Java Runtime Environment. |
| JVM | The Java Virtual Machine that runs bytecode. |
| Literal | A constant value in code. |
| main method | The entry point of a Java program. |
| Object | An instance of a class. |
| OOP | Object-oriented programming. |
| Polymorphism | One operation, many forms. |
| Token | The smallest unit of a program. |
Question bank
Short Answer Questions (2 marks each)
- Define object-oriented programming.
- Distinguish a class and an object.
- What is encapsulation?
- List four features of Java.
- Why is Java platform independent?
- What is bytecode?
- Distinguish JDK, JRE and JVM.
- Why is main declared static?
- Name the five kinds of tokens.
- What are command-line arguments?
Medium Answer Questions (5 marks each)
- Explain the basic concepts of OOP.
- Explain the benefits and applications of OOP.
- Explain the features of Java.
- Compare Java with C and C++.
- Explain the Java environment and the JVM architecture.
- Explain the structure of a Java program with an example.
Long Answer Questions (15 marks each)
- Explain the basic concepts, benefits and applications of object-oriented programming.
- Explain the evolution of Java, its features, and its differences from C and C++.
- Explain the Java environment, bytecode, the JVM, and the steps of implementing a Java program.
- Explain the structure of a Java program, comments, Math functions, tokens, statements and command-line arguments, with examples.
Sources
- Official BCA syllabus Object Oriented Programming using Java, course code 25BCA402SEC01, Unit I
