Introduction To Java (H2) Flashcards

(62 cards)

1
Q

A free-to-use, dynamic, high-level programming language for coding programs such as web apps, mobile apps, enterprise software, big data applications, and server-side technologies.

A

Java

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

Who created Java and when?

A

Sun Microsystems in 1995. Which is now owned by oracle since june 23 2014

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

What are the main features of Java?

A

Multi-platform, Object-Oriented, and network-centric; also considered a platform in itself.

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

What are common uses of Java?

A

game development, cloud computing, big data, artificial intelligence (AI),
and Internet of Things

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

Software that provides the class libraries and resources required for Java programs to run correctly.

A

Java Runtime Environment (JRE)

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

What are 5 advantages of using Java?

A
  1. Active community support
  2. High-quality learning resources
  3. Inbuilt functions and libraries
  4. Strong security features
  5. Platform independence (Write Once, Run Anywhere – WORA)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

A virtual machine and runtime engine that runs Java applications by translating Java bytecode into machine language.

A

JVM
Java Virtual Machine

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

Natural programming languages fall
into two (2) broad categories:

A

Compilers and Interpreters.

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

The program is written in natural English-like syntax with , and the language then translates the entire code into machine language. It converts the source code into a binary program of bytecode.

A

Compiler

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

This checks the bytecode and communicates with the operating system, executing the bytecode instructions line by line

A

Interpreter

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

What makes Java unique compared to other languages?

A

It was the first language to combine both compiling and interpreting using the Java Virtual Machine.

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

What is the file extension of Java source code?

A

.java

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

What is the program file name for the Java interpreter?

A

java.exe

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

Pre-written Java programs that plug and play existing functionality into a code, such as getting the time and date, performing mathematical operations, or manipulating text.

A

Java APIs

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

Give 3 examples of tasks Java APIs can perform.

A

Getting date/time, performing math operations, manipulating text.

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

How many keywords does the Java language have?

A

Around 50.

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

How many classes and methods does the Java API have?

A

Several thousands classes with thousands of methods.

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

What is the basic unit of a Java program?

It also defines a group of objects that includes data members, which are places to store data, and methods which are places to put the program logic

A

A Class.

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

The word ________ is the class name provided by the programmer.

A

Skeleton

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

The name given to program components such as classes, objects, or variables.

A

Identifier

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

What are the rules for naming identifiers?

A

Must begin with a letter, underscore (_), or dollar sign ($), not a digit.
Can contain letters, digits, underscores, or dollar signs, but no spaces.
Case-sensitive.
Cannot use true, false, or null.
Cannot use reserved words.

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

Special words significant to the Java compiler. Aside from class names, these cannot be used as variables, a name used to refer to data stored in the memory.

A

Reserved Words (Keywords)

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

What are the 3 reserved words in public static void main?

A

public → access modifier, required for main().
static → allows main() to run without creating an object.
void → indicates main() does not return a value.

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

After the three (3) keywords is the name of the method.

A

Main

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
What is the parameter of the main method?
String[] args → an array of strings (input arguments).
26
In System.out.println("First Java Application"); what is System?
A class.
27
What is out in the statement?
An object defined in the System class.
28
What is println()?
A method used to print/display output.
29
What is "First Java Application" in the statement?
A literal string (an argument passed to the method).
30
What does every Java statement end with?
A semicolon (;).
31
What symbol is used for single-line comments?
//brr brr patapim brr brr patapim **Forward slash**
32
What symbols are used for multi-line comments?
/* skibidi bop bop dom yes yes Jejdndnn Ndjjdj Jdjdjj Jrjdjjd */
33
includes complete JRE tools for developing, debugging, and monitoring Java applications. This must be installed on the computer to write, compile, and execute Java programs.
Java Development Kit (JDK).
34
What command is used to compile a Java program?
javac [filename].java
35
What command is used to run a Java program?
java [filename] (without .java).
36
What are the steps to save and run a Java program in CMD?
1. Write code in a text editor and save as .java file. 2. Open CMD and change to directory where file is saved. 3. Set JDK path using set path=%path%;[JDK bin directory]. 4. Compile using javac filename.java. 5. Execute using java filename.
37
What analogy is used to describe a class in Java?
A class is like a blueprint for a house, while the object is the actual house built from that blueprint.
38
Where must the whole definition of the Skeleton class be written?
Between the first opening brace { and the last closing brace }.
39
Which primitive values cannot be used as identifiers in Java?
true, false, and null (they are not reserved keywords. They are **Primitive Values**).
40
important software components bundled with the Java Platform.
API (Application Programming Interface)
41
A class name is a type of an ________
Identifier
42
A name used to refer to data stored in the memory.
Variable
43
On line 1, _ are used to identify blocks of code and data. It requires matching opening "**{**"and closing _ "**}**". Thus, the whole definition of the class **Skeleton** should be **between the first opening _** and the **last closing _** on line 5.
Braces → { }
44
A type of **access or visibility modifier**. This keyword is used to **define a main()** method so that the interpreter can execute the program.
Public
45
**tells** that this is a class method. The main method is always declared _ so that it can be executed **without creating an object of the class**.
Static
46
Means that the main is a **non-value-returning** method, which means the main is not expected to return any value.
Void
47
**Inside** the **parentheses after the method name**, _ are listed along with their types to **allow the method to receive values**.
Parameters
48
The main method has a **parameter** called _, an array of type **String**, and the square brackets **[ ]** indicate _, is an array
Args
49
Collection of **similar data types**
Array
50
**Sequence of characters** containing letters, numbers, and symbols.
String
51
A sample program to be saved, compiled, and executed using the **command prompt (CMD)**: What step is this? Write the following code in a text editor such as Notepad (or any text editor.)
Step 1
52
A sample program to be saved, compiled, and executed using the **command prompt (CMD)**: What step is this? If using a Notepad as an editor to write a program, the file must be saved with double quotes (","). Otherwise, it automatically adds a .txt extension. The sample program above should be saved as "Demo.java".
Step 2
53
A sample program to be saved, compiled, and executed using the **command prompt (CMD)**: What step is this: Open the DOS window (cmd), then change the directory to the directory where the Java file was saved.
Step 3
54
A sample program to be saved, compiled, and executed using the **command prompt (CMD)**: What step is this? Set the path of JDK using the path command. This setting tells the operating system where to find the Java compiler and the classes. Setting the path of JDK is defined as set path=%path%;[JDK bin directory]
Step 4
55
A sample program to be saved, compiled, and executed using the **command prompt (CMD)**: What step is this? Compile the Java program using the javac command: javac [name of the Java file].java
Step 5
56
A sample program to be saved, compiled, and executed using the **command prompt (CMD)**: What step is this? Execute the compiled Java program using the **java command** (interpreter): **java [name of the Java file]**
Step 6
57
Java code can be written once and run on any underlying platform like Windows, iOS, Android, and Linux without rewriting. This feature is called the _ Philosophy which became a highly sought feature by developers.
“Write Once, Run Anywhere” (WORA)
58
Separate classes, objects, and methods
Dots
59
Java is used for coding:
programs such as **web** applications, **mobile** applications, **enterprise** software, **big data** applications, and **server-side tech**nologies.
60
The programming statements or source code are stored on a disk with a
*.java* file extension
61
All Java applications **must include a class containing one** (1) _ method.
Main
62
When executing a Java program, the execution must **always begin** with the _ method.
Main