Wednesday, 30 March 2016

How to Print Different Type of Values in Java

Problem:- 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.

Check This:- HackerRank solution for C++ Domain.


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 ( " " ).


Also check- Geeksforgeeks solution for School Domain in C++.

Extreme Recommended:- Like our Facebook Page or Join our Facebook Group and Google plus Community for up-to-date for a new post or if you have any Query you can ask there with lots of coders also suggest to your Friends to join and like our page, so we can help our community, and don't forget to Subscribe. Enter your Email and click to subscribe.

How to Print Different Type of Values in Java


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:-

How to Print Different Type of Values in Java

You May Also See


1. Java Program To Find Area And Circumference Of Circle

2. Java Program To Print ASCII Value Of Character

3. Java Program To Find Area Of Triangle

4. Java Program to Convert a person's name in Abbreviated

5. Java Program For Calculate A Simple Interest

Extreme Recommended:- Like our Facebook Page or Join our Facebook Group and Google plus Community for up-to-date. If you have any Query or Question you can ask in the group, I will Try To Solve your Query and try to answers of your Questions withing 24 Hours, You can also Email me or comment below Please suggest to your Friends to join and like our page and don't forget to Subscribe. Enter your Email and click to subscribe.

Prashant Chaturvedi

Ghanendra Yadav

Hello, I Am Ghanendra Yadav Owner of This Blog, I am professional Blogger and Programmer. I Love Programming, Logo Making, And Banner Designing. My Highest Qualification is MCA From NIT Warangal. You Can Find Me On Social Media Through Below Link And If You Have Any Query Related To Programming And Other Subject Comment Below or You Can Mail Me I Will Try To Answer Within 24 Hours Email:- yghanendra@student.nitw.ac.in

Find me on Social Media

Facebook | Twitter | Google+ | RSS Feed

2 comments:

  1. How to convert character to ascii value

    ReplyDelete