“entrada java” Respostas de código

entrada java

Scanner in = new Scanner(System.in);
      System.out.print("Please enter hour 1: ");
      int hour1 = in.nextInt();
      System.out.print("Please enter hour 2: ");
      int hour2 = in.nextInt();
      System.out.print("Please enter minute 1: ");
      int min1 = in.nextInt();
      System.out.print("Please enter minute 2: ");
      int min2 = in.nextInt();
Sid Potti

entrada java

import java.util.Scanner;

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);
    }
}
Purple Team

Java Obtenha entrada

Scanner sc = new Scanner(System.in);
String s = sc.next();
int n = sc.nextInt();
double d = sc.nextDouble();
float f = sc.nextFloat();

// more fast way
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String s = br.readLine(); // read line
int c = br.read();        // read single char
Super Stoat

entrada java

import java.util.Scanner;

class Input {
    public static void main(String[] args) {
    	
        Scanner input = new Scanner(System.in);
    	
        System.out.print("Enter an integer: ");
        int number = input.nextInt();
        System.out.println("You entered " + number);

        // closing the scanner object
        input.close();
    }
}
Purple Team

Como usar a entrada em java

import java.util.*;
class b
{
    void main ()
    {
        Scanner in = new Scanner(System.in);
      System.out.print("Please enter you age: ");
      int age = in.nextInt();
      System.out.print("Please enter today's date: ");
      int date = in.nextInt();
      System.out.print("Please enter current month: ");
      int month = in.nextInt();
      System.out.print("Please enter current year: ");
      int year = in.nextInt();
    }
}
WinReck

Respostas semelhantes a “entrada java”

Perguntas semelhantes a “entrada java”

Mais respostas relacionadas para “entrada java” em Java

Procure respostas de código populares por idioma

Procurar outros idiomas de código