English

Define the various Input/Output methods of JAVA.

Advertisements

Question

Define the various Input/Output methods of JAVA.

Definition
Advertisements

Solution

The various Input/Output methods of Java are as follows:

  1. System.out.print(): This method is used to display text or values on the screen without moving the cursor to the next line.
  2. System.out.println(): This method is used to display text or values on the screen and move the cursor to the next line.
  3. System.out.printf(): This method is used to display formatted output using format specifiers.
  4. Scanner Class: The Scanner class is used to accept input from the keyboard. It provides methods such as nextInt(), nextFloat(), nextDouble() and nextLine().
  5. BufferedReader Class: This class is used to read text input efficiently. Its readLine() method reads a complete line of text.
  6. DataInputStream Class: This class is used to read primitive data types from an input stream. It provides methods such as readInt(), readFloat() and readDouble().
shaalaa.com
  Is there an error in this question or solution?
Chapter 3: Programming in Java (Review of Class XI Sections B and C) - EXERCISE [Page 98]

APPEARS IN

Dheeraj Mehrotra Computer Science [English] Class 12
Chapter 3 Programming in Java (Review of Class XI Sections B and C)
EXERCISE | Q 19. | Page 98
Advertisements
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×