Java

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/48

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 9:19 PM on 2/12/25
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

49 Terms

1
New cards

What are the main features of Java?

Java is platform-independent, object-oriented, secure, robust, and multithreaded.

2
New cards

What is the purpose of the Java Development Kit (JDK)?

The JDK is a software development kit that provides tools for developing and executing Java applications.

3
New cards

What is the Java Runtime Environment (JRE)?

The JRE provides the libraries and components necessary to run Java applications.

4
New cards

What is a real-world application of Java?

Java is used in web applications, mobile applications, desktop applications, and enterprise-level solutions.

5
New cards

What does object-oriented programming (OOP) entail?

OOP involves concepts like encapsulation, inheritance, polymorphism, and abstraction.

6
New cards

What are the basic components of a Java program?

A Java program typically includes a class definition, a main method, and executable statements.

7
New cards

How do you compile and execute a Java program?

You compile a Java program using 'javac' command and execute it using 'java' command followed by the class name.

8
New cards

What conventions should be followed in a Java program?

Use camelCase for variable and method names, and PascalCase for class names.

9
New cards

What are Java reserved words?

Reserved words are predefined keywords in Java that cannot be used as identifiers, such as 'class', 'public', 'static', etc.

10
New cards

How do you use comments in Java?

Single-line comments use '//' and multi-line comments use '/* */'.

11
New cards

What does the java.lang package contain?

The java.lang package contains fundamental classes such as String, Math, and System.

12
New cards

How do you declare and initialize a variable in Java?

Declare a variable with a type followed by its name, and assign it a value, e.g., 'int x = 5;'.

13
New cards

What is final in Java?

The 'final' keyword indicates that a variable's value cannot be changed once it is initialized.

14
New cards

What are the basic arithmetic operators in Java?

The basic arithmetic operators are + (addition), - (subtraction), * (multiplication), / (division), and % (modulus).

15
New cards

What is the purpose of the increment and decrement operators?

They are used to increase or decrease a variable's value by one.

16
New cards

What is the difference between == for primitives and objects?

For primitives, == compares values, while for objects, it compares the references.

17
New cards

How do you declare a String variable?

A String variable can be declared as 'String name = "example";'.

18
New cards

What is an ArrayList in Java?

An ArrayList is a resizable array that can store objects and allows dynamic data manipulation.

19
New cards

What method would you use to handle exceptions in Java?

Use try and catch blocks to handle exceptions.

20
New cards

What are the looping statements in Java?

The looping statements include for, while, and do-while loops.

21
New cards

What is a constructor in Java?

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

22
New cards

What is a static method in Java?

A static method belongs to the class rather than any object instance and can be called without creating an instance.

23
New cards

What are accessor and mutator methods?

Accessor methods retrieve values of instance variables, while mutator methods modify them.

24
New cards

What is the purpose of the switch statement?

The switch statement executes code based on the value of a variable matching specified cases.

25
New cards

What is inheritance in Java?

Inheritance is a mechanism where one class can inherit properties and methods from another class.

26
New cards

What is polymorphism in Java?

Polymorphism allows methods to do different things based on the object it is acting upon.

27
New cards

What is encapsulation in Java?

Encapsulation is the concept of wrapping data (variables) and methods into a single unit (class) and restricting access to some components.

28
New cards

What is abstraction in Java?

Abstraction is the concept of hiding complex implementation details and showing only the essential features of an object.

29
New cards

What is the difference between an interface and an abstract class?

An interface is a contract that classes must follow, while an abstract class can provide some implementation and state.

30
New cards

What are Java annotations?

Annotations provide metadata about the Java code and can be used for various purposes such as defining behaviors, configurations, and documentation.

31
New cards

What is the significance of the main method in Java?

The main method is the entry point for any Java application and is where program execution begins.

32
New cards

What is the purpose of the 'synchronized' keyword in Java?

The 'synchronized' keyword is used to control access to a block of code or method by multiple threads, ensuring thread safety.

33
New cards

What is a Java package?

A package is a namespace that groups related classes and interfaces, helping to organize code.

34
New cards

What is the purpose of the 'this' keyword in Java?

The 'this' keyword refers to the current instance of a class, used to distinguish between class attributes and parameters.

35
New cards

What are exception types in Java?

Exception types include checked exceptions (compile-time) and unchecked exceptions (runtime errors).

36
New cards

What is method overloading in Java?

Method overloading allows multiple methods to have the same name with different parameters.

37
New cards

What is the Java Collections Framework?

The Java Collections Framework provides a set of classes and interfaces for storing and manipulating groups of data.

38
New cards

What is a thread in Java?

A thread is a lightweight process that can run concurrently with other threads, allowing multitasking.

39
New cards

What is the role of the garbage collector in Java?

The garbage collector automatically manages memory by reclaiming memory occupied by objects that are no longer in use.

40
New cards

What is the use of the 'super' keyword in Java?

The 'super' keyword is used to access methods and constructors of a superclass in a subclass.

41
New cards

What are instance variables in Java?

Instance variables are non-static variables defined in a class and represent the state of an object.

42
New cards

What is method overriding in Java?

Method overriding allows a subclass to provide a specific implementation of a method that is already defined in its superclass.

43
New cards

What is the role of the 'static' keyword in variable declaration?

The 'static' keyword indicates that the variable belongs to the class rather than instances of the class.

44
New cards

How do you create a multi-dimensional array in Java?

A multi-dimensional array is created by defining the array type followed by multiple brackets, e.g., 'int[][] matrix = new int[3][3];'.

45
New cards

What is a Java interface?

A Java interface is a reference type that can contain only constants, method signatures, default methods, static methods, and nested types.

46
New cards

What are the different types of loops available in Java?

Java provides for, while, and do-while loops for iteration over a sequence or collection.

47
New cards

What is the Java Naming Convention?

Java Naming Convention refers to standard practices for naming classes, methods, and variables to improve code readability.

48
New cards

What is a final class in Java?

A final class cannot be subclassed, meaning no class can extend it.

49
New cards

What is the purpose of the Java 'Cloneable' interface?

The Cloneable interface indicates that a class allows a field-by-field copy of its objects.

Explore top flashcards

flashcards
Dutch B vocab
275
Updated 758d ago
0.0(0)
flashcards
Ecology Test 2025-2026 :D
20
Updated 135d ago
0.0(0)
flashcards
Psych. Chapter 13
38
Updated 1162d ago
0.0(0)
flashcards
Health assessment notes (1)
33
Updated 750d ago
0.0(0)
flashcards
(cz. 2) Historyzm, realizm
28
Updated 404d ago
0.0(0)
flashcards
Cell Vocabulary
21
Updated 1202d ago
0.0(0)
flashcards
Dutch B vocab
275
Updated 758d ago
0.0(0)
flashcards
Ecology Test 2025-2026 :D
20
Updated 135d ago
0.0(0)
flashcards
Psych. Chapter 13
38
Updated 1162d ago
0.0(0)
flashcards
Health assessment notes (1)
33
Updated 750d ago
0.0(0)
flashcards
(cz. 2) Historyzm, realizm
28
Updated 404d ago
0.0(0)
flashcards
Cell Vocabulary
21
Updated 1202d ago
0.0(0)