Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

print different variable datatype

import java.io.*;   
public class PrintDemo  
{   
public static void main(String[] args)   
{   
//declaration of different datatypes   
int num = 122;   
char ch = 'A';   
String str = "Oracle";   
double d = 190.98;   
float f = 3.14f;   
//prints the values on the console  
System.out.println(); //prints nothing but throws the cursor to the next line  
System.out.println(num); //prints integer  
System.out.println(ch); //prints character   
System.out.print(str+"
");   
System.out.print(d +"
");   
System.out.print(f+"
");   
System.out.printf("'%s' %n", "javatpoint");  
System.out.printf("'%S' %n", "Jack");  
}   
}  
Comment

PREVIOUS NEXT
Code Example
Java :: docker how to pass params to spring boot application 
Java :: apache poi excel color 
Java :: MinimumAndMaximum 
Java :: jadavpur university 
Java :: RedisCacheManager json serializer 
Java :: find the length of jtextfeild in java 
Java :: java circular buffer implementation on array 
Java :: determine the distance between two circles in java 
Java :: Which Is Better to Configure a Spring Boot Project — Properties or YAML? 
Java :: play default message ringtone android studio 
Java :: how to validate information against the database in java 
Java :: java map get value 
Java :: binary search tree 
Java :: query spring boot 
Java :: how to make a for loop increment by 2 in java 
Java :: class syntax in java 
Java :: how to delete last array in java 
Java :: find power of number in method java 
Java :: row and column sorted matrix 
Java :: Java Lambda Expressions with parameters 
Java :: how to find a string in a sentence in java 
Java :: how to convert integer to list in python 
Java :: how apache shiro remember me works 
Sql :: PROSYS SQL BKP 
Sql :: mysql current running queries 
Sql :: Failed to stop mysqld.service: Unit mysqld.service not loaded. 
Sql :: sql server find columns list in tables 
Sql :: postgresql add enum value 
Sql :: how to check port number for postgresql 
Sql :: mysql update field from one table to another 
ADD CONTENT
Topic
Content
Source link
Name
8+3 =