0% found this document useful (0 votes)
4 views3 pages

CHP 5 Input in Java

The document provides an overview of input handling in Java, covering comments, the InputStreamReader method, and the Scanner class. It defines key terms such as public, static, and void, and outlines methods for reading different data types. Additionally, it discusses the differences between testing and debugging, as well as types of errors in programming.

Uploaded by

radhikadaksh1983
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views3 pages

CHP 5 Input in Java

The document provides an overview of input handling in Java, covering comments, the InputStreamReader method, and the Scanner class. It defines key terms such as public, static, and void, and outlines methods for reading different data types. Additionally, it discusses the differences between testing and debugging, as well as types of errors in programming.

Uploaded by

radhikadaksh1983
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Grade 9 chp 5 Input in Java

Name the 3 types of comments.

// Single line Comment

/* Multi line Comment */

/** Documentation Comment */

Name the package used for InputStreamReader method

java.io e.g. import java.io.*;

Define

public – It is the keyword used to specify that the function has no restriction. It can
be used anywhere throughout the system.

static – The function does not require object creation.

void - It refers to the non- returnable type function, i.e. it does not return any
value.

Scanner class

Name the package used for Scanner method

java.util.*;

Write the syntax to create a Scanner object

Scanner in = new Scanner(System.in);


What is the significance of using the word new?

The keyword ‘new’ is used for dynamic allocation of an object for the storage of
an object.

Name some of the Delimiters in Scanner class.

Comma ( ,) fullstop (.) semi colon ( ;) whitespace

Name the default token separator.

White space

Name the method to read a character in Scanner class.

next( ).charAt(0);

e.g. char ch=in.next().charAt(0);

Name the method to read an integer value in Scanner class.

nextInt()

e.g. int ch=in.nextInt();

Name the method to read a word in Scanner class.

next();

e.g. String ch=in.next();


Difference between Testing and Debugging

Pg.113

Difference between Syntax error and Logical

Pg. 116

Name the 3 types of error

Syntax error

Logical error

Runtime error

You might also like