Jason
Jason

Reputation: 93

SIMPLE question - trace() in Java?

Just started using Java (for Android, if that matters) and all I want is a write to the Console at runtime. In AS3 it would be trace(), in c# it would be Console.Write()...what is it in Java?

I think this question is so basic/simple that I am having a hard time phrasing my question to Google; Stackoverflow to the rescue! :)

Upvotes: 1

Views: 313

Answers (2)

LuckyLuke
LuckyLuke

Reputation: 49077

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

This will work when you are doing "Android Java", if you use Eclipse it will be shown in LogCat

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

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

Upvotes: 3

poke
poke

Reputation: 387647

Take a look at android.util.Log. Also see the developer reference on debugging in general.

Upvotes: 2

Related Questions