Introduction to Java Flashcards

1
Q

What is Java?

A

It is a programming language created in 1995 that is owned by Oracle.

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

When and where did the development of Java begin?

A

It began in the early 1990s at Sun Microsystems, led by James Gosling.

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

What was the original name of the Java project?

A

It was called “Oak”.

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

When was the name “Java” officially chosen, and what inspired it?

A

1994, inspired by a coffee blend flavor.

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

When was the Java programming language formally announced?

A

at SunWorld ‘95.

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

When was Java 1.0 released, and what was its slogan?

A

1995, “Write Once, Run Anywhere” (WORA)

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

What new features were introduced with Java 1.1 in 1996?

A

Inner classes and the Abstract Window Toolkit (AWT)

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

What major changes were introduced in Java 2 Platform (Java 1.2) in 1997?

A
  1. Swing GUI toolkit
  2. Collections Framework
  3. Java Naming and Directory Interface
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What were the key updates in Java 1.3, released in 2000?

A
  1. Performance Improvement
  2. HotSpot JVM
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What features were introduced with Java 1.4 (J2SE 1.4) in 2002?

A
  1. ‘assert’
  2. Regular Expressions
  3. Java Web Start
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What major features were introduced in Java 5, codenamed “Tiger,” in 2004?

A
  1. Generics
  2. Metadata Annotations
  3. Enumerated Types
  4. Enhanced For Loop
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What were the significant updates in Java 6, also known as “Mustang,” released in 2006?

A
  1. Scripting Support via JC API
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What were the key features introduced in Java 7, codenamed “Dolphin,” in 2011?

A
  1. Try-with-resources Statement
  2. Diamond Operator
  3. Fork/Join Framework
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What groundbreaking features were introduced in Java 8, codenamed “Lambdas,” in 2014?

A
  1. Lambda Expressions
  2. Stream API
  3. java.time package
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What were the significant updates in Java 9, released in 2017?

A
  1. Module System (Project Jigsaw)
  2. HTTP/2 Client
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What were the key updates in Java 10 and Java 11, released in 2018?

A
  1. 10 - Local-variable Type Interference (‘var’)
  2. 11 - Long-term Support (LTS)
16
Q

What notable features were introduced in Java 12 and Java 13, released in 2019?

A

Java 12 and 13 introduced incremental features.

17
Q

What was introduced in Java 14, known as “Project Loom,” in 2020?

A
  1. Fibers (lightweight, user-mode threads)
18
Q

What key features were added in Java 15, Java 16, and Java 17, released in 2021?

A
  1. Records
  2. Pattern Matching
19
Q

How can you check if Java is installed on a Windows PC?

A

Type ‘java -version’ in CMD.

20
Q

Where must every line of code that runs in Java be located?

A

Every line of code that runs in Java must be inside a class.

21
Q

What naming convention should you follow for a class in Java?

A

A class name in Java should always start with an uppercase letter.

22
Q

Is Java case-sensitive?

A

Yes.

“MyClass” and “myclass” have different meanings.

23
Q

What must be true about the filename of a Java file?

A

It must match the class name and should be saved with the “.java” extension.

24
Q

What is the purpose of the main() method in a Java program?

A

The main() method is required in every Java program, and any code inside it will be executed.

25
Q

What must match in every Java program, and what must every program contain?

A

The class name must match the filename, and every program must contain the main() method.

26
Q

What do the curly braces {} signify in a Java program?

A

The curly braces {} mark the beginning and end of a block of code.

27
Q

What are the purposes of comments in Java?

A

Comments in Java are used to explain code, make it more readable, and prevent execution when testing alternative code.

28
Q

How do you write a single-line comment in Java?

A

Single-line comments start with two forward slashes //.

29
Q

How do you write a multi-line comment in Java?

A

Multi-line comments start with /* and end with /. Any text between / and */ will be ignored by Java.

30
Q

How should text be handled in Java code?

A

Text must be wrapped inside double quotation marks “” in Java.

31
Q

What happens if you forget to use double quotes around text in Java?

A

If you forget the double quotes, an error will occur.

32
Q

How do you handle numbers in Java compared to text?

A

Unlike text, numbers are not put inside double quotes in Java.