Lyncy M.

asked • 03/23/21

Java Basic Input And Output

import java.util.Scanner;

OUTPUT

class Input {

public static void main(String[] args) {

Scanner input = new Scanner(System.in);

// Getting float input

System.out.print("Enter float: ");

float myFloat = input.nextFloat();

System.out.println("Float entered = " + myFloat);

// Getting double input

System.out.print("Enter double: ");

double myDouble = input.nextDouble();

System.out.println("Double entered = " + myDouble);

// Getting String input

System.out.print("Enter text: ");

String myString = input.next();

System.out.println("Text entered = " + myString); }}



What is the OUTPUT:

1 Expert Answer

By:

Patrick B. answered • 03/23/21

Tutor
4.7 (31)

Math and computer tutor/teacher

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.