首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >为什么netbeans不在代码中显示系统输出

为什么netbeans不在代码中显示系统输出
EN

Stack Overflow用户
提问于 2018-12-18 04:46:10
回答 1查看 129关注 0票数 0

我在NetBeans中创建了一个预订项目,我首先实现了一个预订控制器,它将使用Java验证用户输入。我想在终端中测试代码和输入数据。当我运行代码终端的输出时,终端只显示“构建成功”。并且没有显示任何系统输出打印代码行。我不太确定代码出了什么问题,请看下面

package fitnessclassapp;
import java.util.Scanner;
public class BookingController {       

   private Scanner input = new Scanner (System.in); 
   Customer customer = new Customer (); 

    // customer enter details and the details are validated   
    private String Customer () { 

        String customerName = ""; 
        int customerAge = -1 ; 
        String  membership  = ""; 
        boolean isName; 

        System.out.println( "Please enter your name " );
        do { 
            // name of condition HasNext will check the user input 
            if ( input.hasNext()) { 
                customerName = input.nextLine();
                isName = true; 

                // add a boolean 
            }else
                System.out.println ( "You have provided incorrect information");

            isName = false; 
            input.next(); 

        }while ( !isName ); 

        System.out.println(customerName); 

        return customerName; 
    }   
}
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53822755

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档