java - 简单问题 - Java 中的 trace()?

标签 java android

刚开始使用 Java(对于 Android,如果重要的话),我想要的只是在运行时写入控制台。在 AS3 中是 trace(),在 C# 中是 Console.Write()...在 Java 中是什么?

我认为这个问题非常基础/简单,以至于我很难向 Google 表达我的问题; Stackoverflow 助你一臂之力! :)

最佳答案

System.out.print --> This will print without a final newline-character
System.out.println --> This will print with a newline-character, but is the same as the above System.out.printf --> This will accept format-specfiers, where the first argument is the mask and the other arguments are replacements.

http://sharkysoft.com/archive/printf/docs/javadocs/lava/clib/stdio/doc-files/specification.htm

这将在您执行“Android Java”时起作用,如果您使用 Eclipse,它将显示在 LogCat 中

Log.d/w/e... --> Android

http://developer.android.com/reference/android/util/Log.html

关于java - 简单问题 - Java 中的 trace()?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6170240/

相关文章:

java - JasperReports Server 和 Swing - 如何从服务器访问存储库/报告

android - 如何在 ListView 中添加多个标题 View

java - 在Java中实例化集合的集合?

java - jvisualvm 作为服务运行时不列出 Jboss 5.1.0GA

android - onDestroy() 的空指针异常

android - 如何在android中处理多个全屏图像。 : Memory concern

java - Android 如何获取当前的系统设置值?

android - 如何按名称(字符串)而不是整数获取资源

java - Hadoop 2.5.2 mvn 构建失败 Windows 7 x64 - hadoop-common 上的 compile-ms-native-dll?

java - 将数据从 Activity 发送到第三方服务