小编Pyt*_*sPi的帖子

如果......不是int {

我试图让程序识别是否未输入int.

我见过以下所有内容:

   if  (v % 1) 
Run Code Online (Sandbox Code Playgroud)

    parseInt();
Run Code Online (Sandbox Code Playgroud)

但他们不适合我.

import java.util.Scanner;

public class LinearSlopeFinder {
    public static void main(String[]args){
        double x1, y1, x2, y2, n1, equation, constant = 0 ;
        double slope, slope1, slopeAns;
        Scanner myScanner = new Scanner(System.in);

        System.out.print("    What is the first set of cordinants? example: x,y ... ");
        String coordinate1 = myScanner.nextLine();

        //below is what i am referring to 


        if (coordinate1 != int ){    // if it is a double or String 
            System.out.println("Sorry, you must use whole …
Run Code Online (Sandbox Code Playgroud)

java int

1
推荐指数
1
解决办法
2万
查看次数

标签 统计

int ×1

java ×1