Q:

How to Print Different Type of Values in Java

0

How to Print Different Type of Values in Java or Displaying Information using print() and println() Methods or Using generic methods to print array of different types or Data types in Java Learn about integer character float double long etc or Returning Multiple values in Java or how to print different type of values in java. java program for printing an integer, float, string, character and boolean values in java. string printing in java.



Explanation:- 
As we know that we have different types of variable in Java such as Integer character float double long string and boolean, now in this problem we have to print these different type of variable. We also know that each variable has a different type of printing pattern like when we have to print character we use single quotes ( ' ' )and for string, we use double quotes ( " " ).

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

class Program2
{
public static void main(String[] args)
{
System.out.println(123456789);
System.out.println(235.254);
System.out.println('P');
System.out.println(true);
System.out.println("Prashant");
}
}

 

Output:

123456789

235.254

P

true

Prashant

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now