examples of print information in java

0

you can print information in java using the command(java will print content inside the 2 braces) : System.out.println("helllo");

notice: java will print the word: hello 

 

example:

java program to add firsnamt and last name then print the resulting full name:

String firstName="ahmed";
String lastName="mahdi";
String fullName=firstName+" "+lastName;
System.out.println(fullName);

All Contributions

java code to print the summation of 2 integers:

int number1=15;
int number2=5;
int result=number1+number2;
System.out.println(result);

 

total contributions (1)

New to examplegeek.com?

Join us