Difference in the use of print, println, and printf.

Answer Posted / glibwaresoftsolutions

The items can be printed using print, println, or printf, but print prints every element while keeping the cursor in the same line. The cursor is moved to the next line via println. Additionally, we can use format identifiers with printf.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between the font and fontmetrics classes in java programming?

683


Write a program in java to find the maximum and minimum value node from a circular linked list.

741


Can a java program have 2 main methods?

764


What is the difference between assignment and initialization?

776


Draw a UML class diagram for the code fragment given below: public class StringApplet extends Applet { private Label sampleString; private Button showTheString; private ButtonHandler bHandler; private FlowLayout layout; public StringApplet() { sampleString = new Label(" "); showTheString = new Button (" Show the String"); bHandler = new ButtonHandler(); layout = new FlowLayout(); showTheString.addActionListener(bHandler); setLayout(layout); add(sampleString); add(showTheString); } class ButtonHandler implements ActionListener { public void actionPerformed(ActionEvent e) { samplestring.setText("Good Morning"); } } } Note: The methods need not be indicated on the diagram.

1801


Can a class extend more than one class?

825


What are the different types of collections in java?

710


Is array a class?

693


How do you do absolute value in java?

719


When can an object reference be cast to an interface reference in java programming?

756


What is the generic function?

720


Why put method is used?

750


Write a program to find maximum and minimum number in array?

738


How do you write a conditional statement?

695


Can abstract class have private constructor?

689