(i) A super class and a subclass: Inheritance
(ii) The act of representing essential features without including background details: Data Abstraction
Ans. digital mp4 = new digital();
Ans. A class encapsulates characteristics and behaviours, i.e., data members and member methods.
Ans. Class is a blueprint, plan, or template that creates objects, while an object is an entity containing the characteristics and behaviors defined within the class.
Ans. Data abstraction is representing essential features without background details. For example, driving a car only requires knowledge of controls, not the internal mechanisms.
Ans. An object is called an instance of a class because it represents a specific example of the blueprint (class) when used in a program.
Ans. A class is called an object factory because it is used to produce objects containing common attributes and behaviors.
Ans. A class is a composite data type because it contains multiple predefined data types within it, and is user-defined.
Ans. Data hiding is implemented by encapsulating data members within the class, accessible only by the class methods, preventing external access.
Ans. Encapsulation wraps data and methods, and abstraction uses the essential methods, both handling the encapsulated data, making them interrelated.
Ans. The syntax to create an object book of class library: library book = new library();
Ans. 'New' is used for dynamic memory allocation, allotting space in memory for storing an object.
Ans. Reusability allows components of a base class to be used in derived classes through inheritance.
Ans. A real-world object contains characteristics and behavior, replaced by data members and methods in a software object, making them interrelated.
Ans. Keyboard is an object belonging to the class computer.
Ans. Polymorphism is the principle that uses a function for multiple operations.
Ans. Static binding links a function at compile time, while dynamic binding links it at runtime.
Ans. Java application programming interface package is a set of various classes where each class internally contains different functions for specific operations. Two application programming interface packages are:
1. java.io
2. java.util
Ans. Byte code is an intermediate binary form of the Java source code that is obtained after being converted with the help of the Java compiler. This code is independent of the machine on which it is to be executed. It makes Java programs highly portable to be used on any platform.
Ans. Java language was developed by a team headed by James Gosling at Sun Microsystems, USA. The hypothetical name of Java was OAK.
Ans. System.out.println("HAPPY RETURNS OF THE DAY");
Ans. The menu-based Java platform is BlueJ.
Ans. Another name of Java Interpreter is JVM (Java Virtual Machine).
Ans. Java keywords are reserved words for the system and carry special meaning for the system compiler. Hence, they cannot be used as variable names as they possess a specific meaning.
Ans. Java uses both a compiler and an interpreter to obtain object code from source code, whereas other languages use either a compiler or an interpreter.
a. Compiler - A compiler is a program that translates code written in a high-level language into machine code.
b. Assembler - An assembler is a program that translates an assembly language program into machine code.
c. Interpreter - An interpreter translates the source code instructions into machine code line-by-line.
Ans. Stand-alone Applications and Applets
Ans. The machine language of the Java Virtual Machine is Bytecode.
Ans. Java applets are Java applications that run within a web browser. They are mainly used for internet programming. The applet is capable of performing many tasks on a web page, such as displaying graphics, playing sounds, and accepting user input.
a. Source code - A set of instructions written in a high-level programming language is called source code.
b. Object code - The compiler-generated machine language version of the source code is called object code.
Ans. The programs written in Java are compiled into a machine language for a virtual computer called Java Virtual Machine (JVM). The machine language for this special Java Virtual Machine is called Java Bytecode. The Bytecode files are generated with the ".class" extension.
Ans. A stand-alone Java application refers to a Java program that can run independently on a computer. Acrobat Reader is an excellent example of this type of application. In Java, every stand-alone application begins its execution with the main() method. Java stand-alone applications can be classified into two types:
a. Console-based applications
b. Graphical User Interface-based applications
Ans. JVM stands for the Java Virtual Machine. A JVM is a virtual machine that runs Java programs. It can be installed on several different operating systems, such as Windows, UNIX, and Macintosh. JVMs allow Java programs to run on almost any computer. The JVM processes instructions in the same way as a physical processor. However, the Java code (with ".java" extension) must first be converted into Bytecode that the JVM understands.
Ans. The JIT compiler compiles selected portions of the Bytecode into executable code to improve the execution performance.
Ans. CoolClass.java
Ans. CoolClass.class
Ans. The platform-independent code is called the Java class file.
Ans. While declaring the main method, the keyword public comes first.