1/45
Vocabulary flashcards defining Java syntax, imports, methods, keywords, and file operations based on the Clinic System notes.
import java.io.File;
Imports the File class for files and folders.
import java.io.FileWriter;
Imports FileWriter for writing text into a file.
import java.io.IOException;
Imports IOException for file-related errors.
import java.util.Scanner;
Imports Scanner for getting input and reading files.
public
Accessible from anywhere.
class
Creates a class.
static
Shared by or belongs to the class.
new
Creates an object.
File
Represents a file or directory.
void
Returns nothing.
main
Starting point of a Java program.
int
Whole number data type.
String
Text data type.
Array
Stores multiple values.
do
Runs the code first in a loop before checking the condition.
while
Repeats execution while a condition is true.
System.out.println()
Prints text and moves to the next line.
System.out.print()
Prints text without moving to a new line.
nextInt()
Gets an integer input.
nextLine()
Gets a line of text.
switch
Checks the value of a variable (such as choice).
break;
Stops the current case.
default
Runs when none of the cases match in a switch statement.
exists()
Checks if something exists.
mkdir()
Creates a directory.
createNewFile()
Creates a new file.
FileWriter
Writes text to a file.
Append Mode (true)
Adds new data after existing data in a file.
write()
Writes data into the file.
System.lineSeparator()
Creates a new line.
close()
Closes the FileWriter.
try
Block of code where an error might happen.
catch
Catches the error that occurs in a try block.
IOException
Type of file error.
e.getMessage()
Gets the error message.
isFile()
Checks if the path is a file.
hasNextLine()
Checks for another line in a Scanner input.
list()
Gets the names inside the folder.
getName()
Gets the file name.
getAbsolutePath()
Gets the complete file path.
length()
Gets the file size in bytes.
canRead()
Checks if the file is readable.
canWrite()
Checks if the file is writable.
delete()
Deletes the file, or deletes the directory if it is empty.
return;
Ends the method immediately.
//
Denotes a comment that is ignored by Java and helps explain the code.