1. What is Java?
Java is a high-level, object-oriented programming language that is widely used for
developing a variety of applications, including web, desktop, and mobile applications.
2. What is the difference between Java and JavaScript?
Java and JavaScript are two different programming languages with different purposes.
Java is used for building applications, while JavaScript is primarily used for adding
interactivity to web pages.
3. What is the main principle of Java programming?
Java follows the principle of "write once, run anywhere" (WORA), which means that
Java code can be compiled into bytecode and executed on any platform that has a
Java Virtual Machine (JVM).
4. What are the main features of Java?
Some of the main features of Java include platform independence, object-oriented
programming, automatic memory management (garbage collection), and strong type
checking.
5. What is a class in Java?
In Java, a class is a blueprint or template for creating objects. It defines the properties
(attributes) and behaviors (methods) that objects of that class can have.
6. What is an object in Java?
An object in Java is an instance of a class. It represents a specific entity or item that
can have its own set of attributes and behaviors defined by its class.
7. What is a method in Java?
A method in Java is a block of code that performs a specific task. It can be called or
invoked to execute its defined functionality.
8. What is the difference between a class and an object?
A class is a blueprint or template, while an object is an instance of that class. A class
defines the structure and behavior of objects, while objects represent specific
Dostları ilə paylaş: |