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)

  1. Define object-oriented programming.
  2. Distinguish a class and an object.
  3. What is encapsulation?
  4. List four features of Java.
  5. Why is Java platform independent?
  6. What is bytecode?
  7. Distinguish JDK, JRE and JVM.
  8. Why is main declared static?
  9. Name the five kinds of tokens.
  10. What are command-line arguments?

Medium Answer Questions (5 marks each)

  1. Explain the basic concepts of OOP.
  2. Explain the benefits and applications of OOP.
  3. Explain the features of Java.
  4. Compare Java with C and C++.
  5. Explain the Java environment and the JVM architecture.
  6. Explain the structure of a Java program with an example.

Long Answer Questions (15 marks each)

  1. Explain the basic concepts, benefits and applications of object-oriented programming.
  2. Explain the evolution of Java, its features, and its differences from C and C++.
  3. Explain the Java environment, bytecode, the JVM, and the steps of implementing a Java program.
  4. 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