Define the various Input/Output methods of JAVA.
Advertisements
प्रश्न
Define the various Input/Output methods of JAVA.
व्याख्या
Advertisements
उत्तर
The various Input/Output methods of Java are as follows:
System.out.print(): This method is used to display text or values on the screen without moving the cursor to the next line.System.out.println(): This method is used to display text or values on the screen and move the cursor to the next line.System.out.printf(): This method is used to display formatted output using format specifiers.ScannerClass: The Scanner class is used to accept input from the keyboard. It provides methods such asnextInt(),nextFloat(),nextDouble()andnextLine().BufferedReaderClass: This class is used to read text input efficiently. ItsreadLine()method reads a complete line of text.DataInputStreamClass: This class is used to read primitive data types from an input stream. It provides methods such asreadInt(),readFloat()andreadDouble().
shaalaa.com
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
