Does sprintf add a null terminator?



Does sprintf add a null terminator?..

Answer / Lokesh Kumar

"sprintf in C adds a null terminator at the end of the string. In Java, there is no sprintf; instead, you can use String.format(). However, it does not automatically add a null terminator."

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

What are the ways of polymorphism other than Overridding & Overloading

1 Answers  


How the elements are organized in GridBagLayout?

1 Answers  


What is java argument list?

1 Answers  


Explain the difference between jvm and jre?

1 Answers  


How do you sort a string in java?

1 Answers  


What is the difference between getCodeBase and getDocumentBase methods?

1 Answers   CS Business Services,


How do you sort data in java?

1 Answers  


How do you declare a string variable?

1 Answers  


If a class is declared without any access modifiers, where can the class be accessed?

1 Answers  


Is java pure object oriented or not? if yes, give the valid reason.

13 Answers   Emphasis, NIIT, Syntel, Wipro,


Justify your answer that you can't define a method inside another method in java, if you can then how?

1 Answers  


After compilation of java program we'll get .class code. If it's generated in OS Windows XP will it work on OS Linux? If yes why? If no why?

5 Answers   Aricent,


Categories