Java Basics Flashcards

(132 cards)

1
Q

Define Java.

A

A high-level, object-oriented programming language used for building applications.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the JDK?

A

Java Development Kit, a software development environment for developing Java applications.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

True or false: Java is platform-independent.

A

TRUE

Java’s ‘write once, run anywhere’ capability is due to the Java Virtual Machine.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Fill in the blank: JVM stands for _______.

A

Java Virtual Machine

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does OOP stand for?

A

Object-Oriented Programming, a programming paradigm based on objects.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Define class in Java.

A

A blueprint for creating objects, containing fields and methods.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is an object in Java?

A

An instance of a class that contains data and methods.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

True or false: Java supports multiple inheritance.

A

FALSE

Java does not allow multiple inheritance to avoid complexity and ambiguity.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What keyword is used to create a class?

A

The keyword ‘class’ is used to define a class.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Fill in the blank: The main method signature is _______.

A

public static void main(String[] args)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Define method in Java.

A

A block of code that performs a specific task and can be called.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is a constructor?

A

A special method used to initialize objects when they are created.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

True or false: A constructor has a return type.

A

FALSE

Constructors do not have a return type, not even void.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is inheritance?

A

A mechanism where one class acquires properties of another class.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Define encapsulation.

A

The bundling of data and methods that operate on that data within a class.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is polymorphism?

A

The ability of a method to do different things based on the object it is acting upon.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Fill in the blank: Interface is a _______ in Java.

A

reference type, similar to a class, that can contain only constants, method signatures, etc.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What is the super keyword?

A

Used to refer to the immediate parent class object.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

True or false: Java has primitive data types.

A

TRUE

Primitive types include int, char, boolean, and others.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What is an array?

A

A container object that holds a fixed number of values of a single type.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Define String in Java.

A

A sequence of characters, used to represent text.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What is exception handling?

A

A mechanism to handle runtime errors, allowing the program to continue execution.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Fill in the blank: The try block is used for _______.

A

code that might throw an exception.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What is the finally block?

A

A block that executes after try and catch, regardless of exception occurrence.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
True or false: Java uses **garbage collection**.
TRUE ## Footnote Garbage collection automatically manages memory by reclaiming unused objects.
26
What is a **package** in Java?
A namespace that organizes a set of related classes and interfaces.
27
Define **abstract class**.
A class that cannot be instantiated and may contain abstract methods.
28
What is a **static method**?
A method that belongs to the class rather than any object instance.
29
Fill in the blank: **final** keyword is used to declare _______.
constants, methods that cannot be overridden, or classes that cannot be subclassed.
30
What does **this** keyword refer to?
The current object instance within a method or constructor.
31
True or false: Java supports **operator overloading**.
FALSE ## Footnote Java does not allow operator overloading to maintain simplicity.
32
What is **Java API**?
A set of classes and interfaces that provide functionality for Java applications.
33
Define **thread** in Java.
A lightweight process that allows concurrent execution of code.
34
What is **synchronization**?
A mechanism to control access to shared resources by multiple threads.
35
Fill in the blank: **Runnable** is an interface for _______.
defining a task that can be executed by a thread.
36
What is a **Java applet**?
A small application that runs in a web browser.
37
True or false: Java supports **multi-threading**.
TRUE ## Footnote Java allows multiple threads to run concurrently for better performance.
38
What is **JavaFX**?
A software platform for creating rich internet applications with Java.
39
Define **Swing**.
A GUI toolkit for Java that provides a set of components for building graphical user interfaces.
40
What is **Java Servlet**?
A Java program that runs on a server and handles client requests.
41
Fill in the blank: **JSP** stands for _______.
JavaServer Pages
42
What is the **Java Collections Framework**?
A set of classes and interfaces for storing and manipulating groups of objects.
43
True or false: **ArrayList** is a part of the Java Collections Framework.
TRUE ## Footnote ArrayList allows dynamic arrays that can grow as needed.
44
What does **HashMap** do?
Stores key-value pairs and allows for fast retrieval based on keys.
45
Define **Iterator**.
An interface that provides methods to iterate over a collection.
46
What is **Java Bean**?
A reusable software component that follows specific conventions.
47
Fill in the blank: **JUnit** is a framework for _______.
unit testing Java applications.
48
What is **JavaFX Scene Builder**?
A visual layout tool for designing JavaFX user interfaces.
49
True or false: Java supports **functional programming** features.
TRUE ## Footnote Java 8 introduced lambda expressions and streams for functional programming.
50
What is a **lambda expression**?
A concise way to represent an anonymous function in Java.
51
Define **stream** in Java.
A sequence of elements supporting sequential and parallel aggregate operations.
52
What is **method reference**?
A shorthand notation of a lambda expression to call a method.
53
Fill in the blank: **Optional** is used to represent _______.
a value that may or may not be present.
54
What is **Java 9's** module system?
A feature that allows developers to modularize their applications.
55
True or false: **Java 8** introduced default methods in interfaces.
TRUE ## Footnote Default methods allow adding new methods to interfaces without breaking existing implementations.
56
What is **try-with-resources**?
A statement that automatically closes resources when done.
57
Define **var** in Java.
A keyword introduced in Java 10 for local variable type inference.
58
What is **Java 11** known for?
It is a long-term support release with new features and enhancements.
59
Fill in the blank: **Java 14** introduced _______.
Helpful NullPointerExceptions.
60
What is **Java 15** known for?
It introduced text blocks for multi-line string literals.
61
True or false: **Java 16** supports records.
TRUE ## Footnote Records provide a compact syntax for declaring data classes.
62
What is **Java 17** known for?
It is the latest long-term support release with new language features.
63
Define **Java 18**.
A release that introduced new features like pattern matching for switch.
64
What is **Java 19** known for?
It introduced virtual threads for lightweight concurrency.
65
Fill in the blank: **Java 20** introduced _______.
record patterns.
66
What is the **Java Community Process**?
A formalized process for developing and revising Java technology specifications.
67
True or false: **Java SE** stands for Standard Edition.
TRUE ## Footnote Java SE is the core Java platform for general-purpose programming.
68
What does **Java EE** stand for?
Java Platform, Enterprise Edition, used for building enterprise applications.
69
Define **Java ME**.
Java Platform, Micro Edition, designed for mobile and embedded devices.
70
What is the **Java Naming and Directory Interface**?
An API for accessing naming and directory services.
71
Fill in the blank: **Java RMI** stands for _______.
Remote Method Invocation.
72
What is **Java Security Manager**?
A class that allows applications to implement a security policy.
73
True or false: Java supports **native methods**.
TRUE ## Footnote Native methods are implemented in languages like C or C++.
74
What is **Java Native Interface**?
A framework that allows Java code to call or be called by native applications.
75
Define **Java Virtual Machine Specification**.
A document that describes the implementation of the Java Virtual Machine.
76
What is the **Java Language Specification**?
A formal specification of the Java programming language syntax and semantics.
77
Fill in the blank: **Java Development Kit** includes _______.
the Java Runtime Environment and development tools.
78
What is **Java Runtime Environment**?
A set of software tools for running Java applications.
79
True or false: **JavaFX** is used for desktop applications.
TRUE ## Footnote JavaFX is designed for creating rich desktop applications.
80
What is **Java Web Start**?
A framework for launching Java applications directly from the web.
81
Define **JavaFX CSS**.
A stylesheet language used to style JavaFX applications.
82
What is **JavaFX FXML**?
An XML-based language for defining the user interface in JavaFX applications.
83
Fill in the blank: **JavaFX Scene** represents _______.
the visual content of a JavaFX application.
84
What is **JavaFX Node**?
The base class for all scene graph nodes in JavaFX.
85
True or false: **JavaFX** supports 3D graphics.
TRUE ## Footnote JavaFX provides support for 3D shapes and effects.
86
What is **JavaFX Animation**?
A class for creating animations in JavaFX applications.
87
Define **JavaFX Event Handling**.
A mechanism for responding to user interactions in JavaFX applications.
88
What is **JavaFX Layout**?
A way to arrange nodes in a JavaFX application.
89
Fill in the blank: **JavaFX Control** is a _______.
UI component that provides user interaction.
90
What is **JavaFX Chart**?
A class for creating graphical charts in JavaFX applications.
91
True or false: **JavaFX** is built on top of Swing.
FALSE ## Footnote JavaFX is a separate framework and not built on Swing.
92
What is **JavaFX Media**?
A class for playing audio and video in JavaFX applications.
93
Define **JavaFX WebView**.
A component that allows embedding web content in JavaFX applications.
94
What is **JavaFX WebEngine**?
A class for managing web content in JavaFX applications.
95
Fill in the blank: **JavaFX CSS** allows _______.
styling of JavaFX applications using CSS.
96
What is **JavaFX Scene Graph**?
A hierarchical tree of nodes representing the visual elements of a JavaFX application.
97
True or false: **JavaFX** is only for mobile applications.
FALSE ## Footnote JavaFX is used for desktop, web, and mobile applications.
98
What is **JavaFX Scene Builder** used for?
A visual tool for designing JavaFX user interfaces without coding.
99
Define **JavaFX Properties**.
A mechanism for binding UI elements to data in JavaFX applications.
100
What is **JavaFX Binding**?
A technique for synchronizing properties in JavaFX applications.
101
Fill in the blank: **JavaFX ObservableList** is a _______.
list that allows listeners to track changes.
102
What is **JavaFX Task**?
A class for running background tasks in JavaFX applications.
103
True or false: **JavaFX** supports responsive design.
TRUE ## Footnote JavaFX layouts can adapt to different screen sizes.
104
What is **JavaFX Stage**?
The top-level container for a JavaFX application.
105
Define **JavaFX Scene**.
The container for all content in a JavaFX application.
106
What is **JavaFX Pane**?
A base class for layout containers in JavaFX.
107
Fill in the blank: **JavaFX Group** is a _______.
container that can hold multiple nodes.
108
What is **JavaFX ImageView**?
A node for displaying images in JavaFX applications.
109
True or false: **JavaFX** supports animations.
TRUE ## Footnote JavaFX provides built-in classes for creating animations.
110
What is **JavaFX Button**?
A UI control that triggers an action when clicked.
111
Define **JavaFX Label**.
A UI control used to display text in JavaFX applications.
112
What is **JavaFX TextField**?
A UI control that allows user input in text format.
113
Fill in the blank: **JavaFX ComboBox** is a _______.
drop-down list for selecting items.
114
What is **JavaFX ListView**?
A UI control for displaying a list of items.
115
True or false: **JavaFX** can be used for game development.
TRUE ## Footnote JavaFX can be used to create 2D games and simulations.
116
What is **JavaFX Canvas**?
A node that allows for drawing graphics in JavaFX applications.
117
Define **JavaFX Shape**.
A base class for all shape nodes in JavaFX.
118
What is **JavaFX Circle**?
A shape node that represents a circle in JavaFX.
119
Fill in the blank: **JavaFX Rectangle** is a _______.
shape node that represents a rectangle.
120
What is **JavaFX Polygon**?
A shape node that represents a polygon in JavaFX.
121
True or false: **JavaFX** supports 2D graphics.
TRUE ## Footnote JavaFX provides classes for creating 2D shapes and effects.
122
What is **JavaFX Color**?
A class for representing colors in JavaFX applications.
123
Define **JavaFX Gradient**.
A class for creating color gradients in JavaFX.
124
What is **JavaFX Image**?
A class for representing images in JavaFX applications.
125
Fill in the blank: **JavaFX Text** is used for _______.
displaying text in JavaFX applications.
126
What is **JavaFX Font**?
A class for representing font styles in JavaFX.
127
True or false: **JavaFX** can handle multimedia.
TRUE ## Footnote JavaFX supports audio and video playback.
128
What is **JavaFX MediaPlayer**?
A class for controlling media playback in JavaFX applications.
129
Define **JavaFX MediaView**.
A node for displaying media content in JavaFX.
130
What is **JavaFX WebView**?
A node that allows displaying web content in JavaFX applications.
131
Fill in the blank: **JavaFX WebEngine** is used for _______.
managing web content in JavaFX applications.
132
What is **JavaFX WebHistory**?
A class for managing the history of web pages in WebView.