পৃষ্ঠাসমূহ

Search Your Article

CS

 

Welcome to GoogleDG – your one-stop destination for free learning resources, guides, and digital tools.

At GoogleDG, we believe that knowledge should be accessible to everyone. Our mission is to provide readers with valuable ebooks, tutorials, and tech-related content that makes learning easier, faster, and more enjoyable.

What We Offer:

  • 📘 Free & Helpful Ebooks – covering education, technology, self-development, and more.

  • 💻 Step-by-Step Tutorials – practical guides on digital tools, apps, and software.

  • 🌐 Tech Updates & Tips – simplified information to keep you informed in the fast-changing digital world.

  • 🎯 Learning Support – resources designed to support students, professionals, and lifelong learners.

    Latest world News 

     

Our Vision

To create a digital knowledge hub where anyone, from beginners to advanced learners, can find trustworthy resources and grow their skills.

Why Choose Us?

✔ Simple explanations of complex topics
✔ 100% free access to resources
✔ Regularly updated content
✔ A community that values knowledge sharing

We are continuously working to expand our content library and provide readers with the most useful and relevant digital learning materials.

📩 If you’d like to connect, share feedback, or suggest topics, feel free to reach us through the Contact page.

Pageviews

Thursday, January 19, 2017

Java.util.Formatter Class

Introduction

The java.util.Formatter class provides support for layout justification and alignment, common formats for numeric, string, and date/time data, and locale-specific output.Following are the important points about Formatter:

  • Formatters are not necessarily safe for multithreaded access.Thread safety is optional and is the responsibility of users of methods in this class.

Class declaration

Following is the declaration for java.util.Formatter class:
public final class Formatter
   extends Object
   implements Closeable, Flushable

Class constructors

S.N. Constructor & Description
1 Formatter()
This constructor constructs a new formatter.
2 Formatter(Appendable a)
This constructor constructs a new formatter with the specified destination.
3 Formatter(Appendable a, Locale l)
This constructor constructs a new formatter with the specified destination and locale.
4 Formatter(File file)
This constructor constructs a new formatter with the specified file.
5 Formatter(File file, String csn)
This constructor constructs a new formatter with the specified file and charset.
6 Formatter(File file, String csn, Locale l)
This constructor constructs a new formatter with the specified file, charset, and locale.
7 Formatter(Locale l)
This constructor constructs a new formatter with the specified locale.
8 Formatter(OutputStream os)
This constructor constructs a new formatter with the specified output stream.
9 Formatter(OutputStream os, String csn)
This constructor constructs a new formatter with the specified output stream and charset.
10 Formatter(OutputStream os, String csn, Locale l)
This constructor constructs a new formatter with the specified output stream, charset, and locale.
11 Formatter(PrintStream ps)
This constructor constructs a new formatter with the specified print stream.
12 Formatter(String fileName)
This constructor constructs a new formatter with the specified file name.
13 Formatter(String fileName, String csn)
This constructor constructs a new formatter with the specified file name and charset.
14 Formatter(String fileName, String csn, Locale l)
This constructor constructs a new formatter with the specified file name, charset, and locale.

Class methods

S.N. Method & Description
1 void close()
This method closes this formatter.
2 void flush()
This method flushes this formatter.
3 Formatter format(Locale l, String format, Object... args)
This method writes a formatted string to this object's destination using the specified locale, format string, and arguments.
4 Formatter format(String format, Object... args)
This method writes a formatted string to this object's destination using the specified format string and arguments.
5 IOException ioException()
This method returns the IOException last thrown by this formatter's Appendable.
6 Locale locale()
This method returns the locale set by the construction of this formatter.
7 Appendable out()
This method returns the destination for the output.
8 String toString()
This method returns the result of invoking toString() on the destination for the output.

Methods inherited

This class inherits methods from the following classes:
  • java.util.Object

No comments:

Post a Comment