• Post Reply Bookmark Topic Watch Topic
  • New Topic

print ????  RSS feed

 
mike cool
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
can you tell me how printf works and its character ex (%s %d %..etc)
and where is it in the api
is there any url refer to this ?
thanks
 
Scott Selikoff
author
Bartender
Posts: 4093
21
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Searching "java printf api" on google...

For the method:

PrintStream API

which uses a Formatter:

Formatter API
 
jiju ka
Ranch Hand
Posts: 308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

can you tell me how printf works and its character ex (%s %d %..etc)
and where is it in the api
is there any url refer to this ?


printf is specific to C language. In java language you can accomplish the same with System.out.print()

Below are few examples.


println puts an extra '\n' at end than print

The '+' operator is not necessary. For Objects (npt primitives) the toString method will be executed to print the object.
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by jiju ka:

printf is specific to C language.


No, actually. In Tiger (JDK 1.5), PrintStream (and thus System.out) now has a printf method. Check it out here.
[ October 31, 2005: Message edited by: Ernest Friedman-Hill ]
 
jiju ka
Ranch Hand
Posts: 308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks to Earnest. You are right printf is part of jdk 1.5 version
[ November 01, 2005: Message edited by: jiju ka ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!