Flashcards

Quick study sessions to strengthen memory and retain key concepts.

Flashcard Study

Java: Console Input and Output

Front

Understanding 'System.out.println()'?

Prints text to the console output. Frame the concept in practical terms so you can explain it during…

View Card →
Flashcard Study

Java: Console Input and Output

Front

Formatting a price to two decimals?

Use 'printf()' with '%.2f'. Frame the concept in practical terms so you can explain it during interview discussion.…

View Card →
Flashcard Study

Java: Console Input and Output

Front

Reading a price with Scanner?

Use 'nextDouble()' for accurate price input. Using 'nextDouble()' ensures that you read the price as a floating-point number,…

View Card →
Flashcard Study

Java: Console Input and Output

Front

Using printf() with incorrect format specifier?

It results in a runtime error or incorrect output. Using an incorrect format specifier, like '%d' for a…

View Card →
Flashcard Study

Java: Console Input and Output

Front

Why clear input buffer after nextInt()?

To prevent unexpected input reading. Frame the concept in practical terms so you can explain it during interview…

View Card →
Flashcard Study

Java: Console Input and Output

Front

Reading a floating-point number with Scanner?

Use 'nextDouble()'. Frame the concept in practical terms so you can explain it during interview discussion. For reading…

View Card →
Flashcard Study

Java: Console Input and Output

Front

Formatting double values for prices?

Use 'printf()' with '%.2f'. Frame the concept in practical terms so you can explain it during interview discussion.…

View Card →
Flashcard Study

Java: Console Input and Output

Front

Printing without newline: which method?

Use 'print()' instead of 'println()'. Frame the concept in practical terms so you can explain it during interview…

View Card →
Flashcard Study

Java: Console Input and Output

Front

Handling non-numeric input with nextInt()?

It throws an InputMismatchException. Frame the concept in practical terms so you can explain it during interview discussion.…

View Card →
Flashcard Study

Java: Console Input and Output

Front

Why separate input from calculations?

To improve code organization and readability. Separating input handling from calculations makes your code cleaner and easier to…

View Card →