Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

print two varaibles using one statement in java

// If you want to print two strings, just concatenate them
System.out.println("Name : " + namestring + "Surname : " + surnamestring);

// for non string variables, you have to use a little hack
System.out.println(int1 + " " + int2);
Comment

PREVIOUS NEXT
Code Example
Java :: android fragment fullscreen 
Java :: font type javafx button css 
Java :: how to instantiate hashmap in java 
Java :: convert optional object to object java 
Java :: android java convert double to 2 decimal places 
Java :: How to validate a binary search tree, in Java? 
Java :: java if one sting on array match 
Java :: hashmap sort by value descending 
Java :: set char value to null java 
Java :: spring jpa count all rows 
Java :: how to make an activity default in android studio 
Java :: arrays.fill java 
Java :: size of queue in java 
Java :: calendar java add 1 day 
Java :: how to print array 
Java :: java read lines from file 
Java :: add seconds to today date and time java 
Java :: how to scan a string in java 
Java :: java rock paper scissors 
Java :: java char to charsequence 
Java :: java decimalformat 
Java :: How do I make a splash screen? 
Java :: how to resize image in android programmatically 
Java :: android translate string java 
Java :: Unsupported Modules Detected 
Java :: java get year from date 
Java :: string remove last character 
Java :: how to use scanners in java 
Java :: java observer pattern 
Java :: java stream get list of one field 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =