System.out.println不起作用 [英] System.out.println not functioning

查看:348
本文介绍了System.out.println不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在什么情况下Java的System.out.println无法产生任何输出.我在方法内部调用了它,有时在调用该方法时得到了println,而有时却没有.

What are some scenarios in which java's System.out.println would fail to produce any output. I have a call to it inside of a method and sometimes when the method is called I get the println and othertimes I don't.

更新:我还在println之后使用System.out.flush().

Update: I am also using System.out.flush() after the println.

更新:感谢您的调试帮助.原来是打开一个对话框的阻塞调用,使输出看起来与正常顺序大相径庭.我以为我要打印消息的方法是在对话框关闭时被调用的,但是该方法本身就是在调用对话框,因此关闭后,它已经超过了打印输出,这就是我开始寻找测试的地方.如果某人有能力删除此问题,因为该问题不是最初提出的问题,那么将不胜感激.

Update: Thank you for the debugging help. It turned out a blocking call to open a dialog made output appear vastly out of the proper order. I thought the method I was trying to print messages for was being called when the dialog closed but the method itself was what was calling the dialog and so after the closing it was already past the printouts which was where i started looking for the test. If someone has the ability to delete this question as the issue was not what was originally asked it'd be appreciated.

推荐答案

答案,按照@BalusC的建议-

answer as per @BalusC's suggestion--

感谢您的调试帮助.原来是打开一个对话框的阻塞调用,使输出看起来与正常顺序大相径庭.我以为我要打印消息的方法是在对话框关闭时被调用的,但是该方法本身就是在调用对话框,因此关闭后,它已经通过了打印输出,这是我开始寻找测试的地方.如果某人有能力删除此问题,因为该问题不是最初提出的问题,那么将不胜感激.

Thank you for the debugging help. It turned out a blocking call to open a dialog made output appear vastly out of the proper order. I thought the method I was trying to print messages for was being called when the dialog closed but the method itself was what was calling the dialog and so after the closing it was already passed the printouts which were where I started looking for the test. If someone has the ability to delete this question as the issue was not what was originally asked it'd be appreciated.

这篇关于System.out.println不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆