csci Flashcards

1
Q

What is Java?

A

An object-oriented programming language that is safe and platform independent.

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

What are the two types of Java programs?

A
  • Applications
  • Applets (now outdated and deprecated)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Define Java Applications.

A

General-purpose programs that are standalone and executed through the operating system.

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

Define Java Applets.

A

Programs meant for the WWW, embedded in a Web page, normally executed through a browser.

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

What is the structure of a Java program?

A
  • (optional) import declarations
  • class declaration
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What should the class name match in Java?

A

The file name.

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

What is a Command Line Interface?

A

An entirely text-based system where the user types commands from the keyboard.

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

What is a shell in the context of a Command Line Interface?

A

A program that interprets and processes commands entered in the command line interface.

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

Name two commonly used shells on Windows.

A
  • Command Prompt
  • PowerShell
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Name two commonly used shells on Mac and Linux.

A
  • Bash
  • Zsh (Z Shell)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What does the command ‘md <folder-name>' do in Windows?</folder-name>

A

Creates a new folder.

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

What does the command ‘copy <source-file> <dest-file>' do in Windows?</dest-file></source-file>

A

Copies the <source></source> to a file called <dest-file>.</dest-file>

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

What does the command ‘del <file.ext>' do in Windows?</file.ext>

A

Deletes a file.

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

What is the command to compile a Java program?

A

javac <java-source-file></java-source-file>

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

What is the command to execute a Java program?

A

java <java-class-name></java-class-name>

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

What does ‘javadoc <java-source-file>' do?</java-source-file>

A

Generates Java documentation.

17
Q

What does ‘javap <java-class-name>' do?</java-class-name>

A

Prints information about the Java class.

18
Q

What is an object in Java?

A

A ‘thing’ that has type, identity, state, and behavior.

19
Q

What defines the ‘type’ of an object?

A

It belongs to a ‘class’ of similar objects.

20
Q

What is the ‘identity’ of an object?

A

A distinct ‘instance’ of a class of objects.

21
Q

What does the ‘state’ of an object refer to?

A

A set of properties (fields) each field can have different values.

22
Q

What is ‘behavior’ in terms of an object?

A

Methods that the object knows how to do.

23
Q

What is a class in Java?

A

A definition that can have multiple instances, where each instance is a separate object.

24
Q

What is a mutator method?

A

A method that primarily modifies an object’s state.

25
What is an accessor method?
A method that returns something about an object.
26
What is a format specifier?
A sequence that starts with % and specifies how to format an argument.
27
What does the conversion character 'd' represent in format specifiers?
Integer.
28
What does the conversion character 'f' represent in format specifiers?
Float.
29
What does the conversion character 's' represent in format specifiers?
String.
30
What does the conversion character 'c' represent in format specifiers?
Character.
31
What is the optional width in a format specifier?
Minimum number of spaces to display the argument.
32
What is the optional precision in a format specifier?
Number of digits after the decimal point.