csci Flashcards
What is Java?
An object-oriented programming language that is safe and platform independent.
What are the two types of Java programs?
- Applications
- Applets (now outdated and deprecated)
Define Java Applications.
General-purpose programs that are standalone and executed through the operating system.
Define Java Applets.
Programs meant for the WWW, embedded in a Web page, normally executed through a browser.
What is the structure of a Java program?
- (optional) import declarations
- class declaration
What should the class name match in Java?
The file name.
What is a Command Line Interface?
An entirely text-based system where the user types commands from the keyboard.
What is a shell in the context of a Command Line Interface?
A program that interprets and processes commands entered in the command line interface.
Name two commonly used shells on Windows.
- Command Prompt
- PowerShell
Name two commonly used shells on Mac and Linux.
- Bash
- Zsh (Z Shell)
What does the command ‘md <folder-name>' do in Windows?</folder-name>
Creates a new folder.
What does the command ‘copy <source-file> <dest-file>' do in Windows?</dest-file></source-file>
Copies the <source></source> to a file called <dest-file>.</dest-file>
What does the command ‘del <file.ext>' do in Windows?</file.ext>
Deletes a file.
What is the command to compile a Java program?
javac <java-source-file></java-source-file>
What is the command to execute a Java program?
java <java-class-name></java-class-name>
What does ‘javadoc <java-source-file>' do?</java-source-file>
Generates Java documentation.
What does ‘javap <java-class-name>' do?</java-class-name>
Prints information about the Java class.
What is an object in Java?
A ‘thing’ that has type, identity, state, and behavior.
What defines the ‘type’ of an object?
It belongs to a ‘class’ of similar objects.
What is the ‘identity’ of an object?
A distinct ‘instance’ of a class of objects.
What does the ‘state’ of an object refer to?
A set of properties (fields) each field can have different values.
What is ‘behavior’ in terms of an object?
Methods that the object knows how to do.
What is a class in Java?
A definition that can have multiple instances, where each instance is a separate object.
What is a mutator method?
A method that primarily modifies an object’s state.