Stay organized with collections
Save and categorize content based on your preferences.
Printer
public
interface
Printer
Known indirect subclasses
|
Simple interface for printing text, allowing redirection to various
targets. Standard implementations are LogPrinter
,
StringBuilderPrinter
, and
PrintWriterPrinter
.
Summary
Public methods |
abstract
void
|
println(String x)
Write a line of text to the output.
|
Public methods
println
public abstract void println (String x)
Write a line of text to the output. There is no need to terminate
the given string with a newline.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# Printer\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nSummary: [Methods](#pubmethods) \n\nPrinter\n=======\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/util/Printer \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\n\n\ninterface\nPrinter\n`\n\n\n`\n\n\n`\n\n|----------------------|\n| android.util.Printer |\n\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known indirect subclasses [LogPrinter](/reference/android/util/LogPrinter), [PrintStreamPrinter](/reference/android/util/PrintStreamPrinter), [PrintWriterPrinter](/reference/android/util/PrintWriterPrinter), [StringBuilderPrinter](/reference/android/util/StringBuilderPrinter) |----------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------| | [LogPrinter](/reference/android/util/LogPrinter) | Implementation of a [Printer](/reference/android/util/Printer) that sends its output to the system log. | | [PrintStreamPrinter](/reference/android/util/PrintStreamPrinter) | Implementation of a [Printer](/reference/android/util/Printer) that sends its output to a [PrintStream](/reference/java/io/PrintStream). | | [PrintWriterPrinter](/reference/android/util/PrintWriterPrinter) | Implementation of a [Printer](/reference/android/util/Printer) that sends its output to a [PrintWriter](/reference/java/io/PrintWriter). | | [StringBuilderPrinter](/reference/android/util/StringBuilderPrinter) | Implementation of a [Printer](/reference/android/util/Printer) that sends its output to a [StringBuilder](/reference/java/lang/StringBuilder). | |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nSimple interface for printing text, allowing redirection to various\ntargets. Standard implementations are [LogPrinter](/reference/android/util/LogPrinter),\n[StringBuilderPrinter](/reference/android/util/StringBuilderPrinter), and\n[PrintWriterPrinter](/reference/android/util/PrintWriterPrinter).\n\nSummary\n-------\n\n| ### Public methods ||\n|------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[println](/reference/android/util/Printer#println(java.lang.String))`(`[String](/reference/java/lang/String)` x) ` Write a line of text to the output. |\n\nPublic methods\n--------------\n\n### println\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void println (String x)\n```\n\nWrite a line of text to the output. There is no need to terminate\nthe given string with a newline.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-----|-----------------|\n| `x` | `String` \u003cbr /\u003e |"]]