Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


diffrence b\w println() and printf()

Answers were Sorted based on User's Feedback



diffrence b\w println() and printf()..

Answer / vidya sarode

println prints on a new line, where as print prints on the
same line.

For example, in your program you use "print" to print the
word "Detroit" and then you use "print" again to
print "smells" the output would be:
Detroitsmells

If you use "print" to print "Detroit" and then you
use "println" to print "smells" your output would be:
Detroit
smells

Is This Answer Correct ?    33 Yes 12 No

diffrence b\w println() and printf()..

Answer / mohneesh

printf in Java works exactly as in C.

it automatically formats your string, which is not possible
in println directly.

System.out.printf("%s\n\t%s","Mohneesh","Wadhwani");

Output:
Mohneesh
Wadhwani

where as you can use String Formatter to format String then
pass it to println to print.

Is This Answer Correct ?    16 Yes 1 No

diffrence b\w println() and printf()..

Answer / atasi

println and printf both showing output,bt in structure programming language,we can use printf() as library function for printing the statement,and in object oriented language we use println for print the statement with new line

Is This Answer Correct ?    15 Yes 3 No

diffrence b\w println() and printf()..

Answer / sethu raj

println() and printf() both shows the output.
But in structure programming language,we can use printf()
as library function for printing the statement,and in
object oriented language we use println for print the
statement with new line.

Is This Answer Correct ?    12 Yes 3 No

diffrence b\w println() and printf()..

Answer / onkar nalawade

println=print the statment and control goes to new line
printf=only print the statement

Is This Answer Correct ?    1 Yes 0 No

diffrence b\w println() and printf()..

Answer / sakthi

printf & println both are used print the output.
println only prints the value only at end but printf prints
the value anywhere inbetween the output statements

Is This Answer Correct ?    0 Yes 1 No

diffrence b\w println() and printf()..

Answer / guest

println means print from new line. 'ln' indicates new(next)
line, it is used in JAVA. where as printf is just used for
print option in C-prog

Is This Answer Correct ?    0 Yes 5 No

diffrence b\w println() and printf()..

Answer / vishnu datt

both are in different class in java. printf(); is used as
scanner class in java.

Is This Answer Correct ?    2 Yes 12 No

Post New Answer

More Core Java Interview Questions

Is it possible to use string in the switch case?

0 Answers  


Can you inherit a constructor java?

0 Answers  


What are the advantages of unicode?

0 Answers  


what are the uses of Class class and what it returns? explain it with the example code.

1 Answers  


What are the main uses of java?

0 Answers  


what is the major difference between linkedlist and arraylist in java?

0 Answers   IBS,


What does a boolean method return?

0 Answers  


Does java vector allow null?

0 Answers  


Nullpointer exception is a very common exception. Why is it not made as a checked exception?

2 Answers   Ness Technologies,


How variables are declared?

0 Answers  


What are classloaders?

0 Answers  


What is the formula to calculate percentage?

0 Answers  


Categories