Computer Science, asked by iamlightningboy, 4 months ago

How do you input a value ‘A’ in the variable sec in Java program?

Answers

Answered by boypro015
2

Answer:

Input refers to text written by the user read by the program. Input is always read as a string. For reading input, we use the Scanner tool that comes with Java. The tool can be imported for use in a program by adding the command import java.util.Scanner; before the beginning of the main program's frame (public class ...). The tool itself is created with Scanner scanner = new Scanner(System.in);.

Answered by ltzSweetAngel
1

Answer:

type variable = value; Where type is one of Java's types (such as int or String ), and variable is the name of the variable (such as x or name). The equal sign is used to assign values to the variable.

Similar questions