Computer Science, asked by DarkAgent131, 7 months ago

I WILL GIVE YOU PPL 5 STARS AND BRAINLIEST
Write down the syntax with reference to Java Programming


to accept a character 'd' through Stream Class

Answers

Answered by sirilillikal63
4

Answer:

Pls mark me as brainiest.

Explanation:

A package needed to import Scanner class.

java.util

A method that accepts a character through Scanner object.

charAt()

A package needed to import Stream Reader class.

java.io

A method that accepts an integer token through Scanner object.

nextInt()

Write down the syntax with reference to Java Programming:

To accept an integral value ‘p’ through Stream class.

p = Integer.parseInt(in.readLine());

To accept a fractional value (float) ‘m’ through Scanner class.

m = sc.nextFloat();

To accept a character ‘d’ through Stream class.

d = in.readLine().charAt(0);

To accept a fractional value ‘n’ in double data type through Stream class.

n = Double.parseDouble(in.readLine());

To accept a word ‘wd’ through Stream class.

wd = in.readLine();

To create a Scanner object.

Scanner sc = new Scanner(System.in);

Similar questions