Java Clinic System Syntax Notes

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/45

flashcard set

Earn XP

Description and Tags

Vocabulary flashcards defining Java syntax, imports, methods, keywords, and file operations based on the Clinic System notes.

46 Terms

1
New cards

import java.io.File;

Imports the File class for files and folders.

2
New cards

import java.io.FileWriter;

Imports FileWriter for writing text into a file.

3
New cards

import java.io.IOException;

Imports IOException for file-related errors.

4
New cards

import java.util.Scanner;

Imports Scanner for getting input and reading files.

5
New cards

public

Accessible from anywhere.

6
New cards

class

Creates a class.

7
New cards

static

Shared by or belongs to the class.

8
New cards

new

Creates an object.

9
New cards

File

Represents a file or directory.

10
New cards

void

Returns nothing.

11
New cards

main

Starting point of a Java program.

12
New cards

int

Whole number data type.

13
New cards

String

Text data type.

14
New cards

Array

Stores multiple values.

15
New cards

do

Runs the code first in a loop before checking the condition.

16
New cards

while

Repeats execution while a condition is true.

17
New cards

System.out.println()

Prints text and moves to the next line.

18
New cards

System.out.print()

Prints text without moving to a new line.

19
New cards

nextInt()

Gets an integer input.

20
New cards

nextLine()

Gets a line of text.

21
New cards

switch

Checks the value of a variable (such as choice).

22
New cards

break;

Stops the current case.

23
New cards

default

Runs when none of the cases match in a switch statement.

24
New cards

exists()

Checks if something exists.

25
New cards

mkdir()

Creates a directory.

26
New cards

createNewFile()

Creates a new file.

27
New cards

FileWriter

Writes text to a file.

28
New cards

Append Mode (true)

Adds new data after existing data in a file.

29
New cards

write()

Writes data into the file.

30
New cards

System.lineSeparator()

Creates a new line.

31
New cards

close()

Closes the FileWriter.

32
New cards

try

Block of code where an error might happen.

33
New cards

catch

Catches the error that occurs in a try block.

34
New cards

IOException

Type of file error.

35
New cards

e.getMessage()

Gets the error message.

36
New cards

isFile()

Checks if the path is a file.

37
New cards

hasNextLine()

Checks for another line in a Scanner input.

38
New cards

list()

Gets the names inside the folder.

39
New cards

getName()

Gets the file name.

40
New cards

getAbsolutePath()

Gets the complete file path.

41
New cards

length()

Gets the file size in bytes.

42
New cards

canRead()

Checks if the file is readable.

43
New cards

canWrite()

Checks if the file is writable.

44
New cards

delete()

Deletes the file, or deletes the directory if it is empty.

45
New cards

return;

Ends the method immediately.

46
New cards

//

Denotes a comment that is ignored by Java and helps explain the code.