What is Java
What is Java
Java is a widely-used, high-level programming language created in 1995 and owned by Oracle.
It is known for its portability, security, and object-oriented features. Java is used in a variety of
applications, including mobile (especially Android), desktop, web, server, and embedded
systems [1] .
What is a Variable?
A variable in Java is a container for storing data values. Variables must be declared with a
specific type, such as int, String, float, etc., and can hold data that can be changed during
program execution [2] .
Features of Java
Object Oriented
Platform Independent
Simple
Secure
Architecture-neutral
Portable
Robust
Multithreaded
Interpreted
High Performance
Distributed
Dynamic [4]
Applications of Java
Mobile applications (especially Android)
Desktop applications
Web applications
Web servers and application servers
Games
Database connectivity
Embedded systems [1]
What is a Method?
A method in Java is a block of code that performs a specific task and can be called to execute
from other parts of the program. Methods can take parameters, return values, and help organize
code for reusability and clarity.
What is Polymorphism?
Polymorphism is an object-oriented concept where a single interface can represent different
underlying forms (data types). In Java, it allows objects to be treated as instances of their
parent class rather than their actual class, enabling method overriding and dynamic method
dispatch.
What is Abstraction?
Abstraction is the process of hiding the complex implementation details and showing only the
essential features of an object. In Java, abstraction is achieved using abstract classes and
interfaces.
What is Inheritance?
Inheritance is an object-oriented feature that allows one class (child/subclass) to inherit fields
and methods from another class (parent/superclass). It promotes code reuse and establishes a
relationship between classes.
What is a Constructor?
A constructor is a special method in Java that is called when an object is instantiated. It has the
same name as the class and does not have a return type. Constructors initialize the object's
state.
Types of Exception
Checked Exceptions: Checked at compile-time (e.g., IOException, SQLException)
Unchecked Exceptions: Checked at runtime (e.g., NullPointerException,
ArithmeticException)
If you need code examples or more details on any specific topic, let me know!
⁂
1. https://www.w3schools.com/java/java_intro.asp
2. https://www.w3schools.com/java/java_variables.asp
3. https://www.justacademy.co/blog-detail/why-is-java-known-as-platform-independent-language
4. https://www.tutorialspoint.com/java/java-features.htm
5. https://abhiandroid.com/java/local-variable-example.html
6. https://www.scaler.com/topics/global-variable-in-java/