0% found this document useful (0 votes)
6 views1 page

Java Unit1 Unit2 Complete Answers

The document provides comprehensive answers for Java Unit 1 and Unit 2 topics, covering key concepts such as Java buzzwords, object-oriented programming features, data types, control statements, inheritance, access control, and the use of packages and interfaces. It explains the differences between classes and methods, the concept of overloading, and introduces garbage collection and recursion. Additionally, it outlines the types of inheritance and the role of the java.io package for input/output operations.

Uploaded by

navadeepngit2453
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views1 page

Java Unit1 Unit2 Complete Answers

The document provides comprehensive answers for Java Unit 1 and Unit 2 topics, covering key concepts such as Java buzzwords, object-oriented programming features, data types, control statements, inheritance, access control, and the use of packages and interfaces. It explains the differences between classes and methods, the concept of overloading, and introduces garbage collection and recursion. Additionally, it outlines the types of inheritance and the role of the java.io package for input/output operations.

Uploaded by

navadeepngit2453
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

JAVA UNIT–1 & UNIT–2 COMPLETE ANSWERS

UNIT – 1
1. Java Buzzwords:
Simple, Object Oriented, Platform Independent, Secure, Robust, Multithreaded, Portable, High
Performance, Distributed, Dynamic.
2. OOP Features:
Encapsulation, Abstraction, Inheritance, Polymorphism, Class & Object.
3. Variable:
A variable stores data.
Types: Local, Instance, Static.
4. Control Statements:
Selection (if, switch), Looping (for, while), Jumping (break, continue).
5. Data Types:
Primitive: int, float, double, char, boolean.
Non-Primitive: String, Array, Class.
6. Class & Object:
Class is blueprint, Object is instance.
7. Overloading:
Same method name, different parameters.
8. Garbage Collection & Recursion:
GC deletes unused objects. Recursion is function calling itself.
9. Matrix Program:
Addition and multiplication using loops.
10. Type Conversion:
Implicit and Explicit casting.
11. Class vs Method:
Class is blueprint, method performs task.
12. Inner Class:
Member, Static, Local, Anonymous.
UNIT – 2
1. Inheritance:
Acquiring properties of another class.
2. Types of Inheritance:
Single, Multilevel, Hierarchical.
3. Access Control:
public, protected, default, private.
4. super & final:
super accesses parent class.
final prevents inheritance.
5. Polymorphism:
Compile time & Run time.
6. Abstraction:
Using abstract class and method.
7. Package & Classpath:
Package groups classes.
Classpath tells JVM where classes exist.
8. Class vs Interface:
Class uses extends.
Interface uses implements.
9. Interface:
Defines abstract methods.
10. [Link] Package:
Used for input/output operations.

You might also like