If(statement){ } Else{ } }
// single line comments /* If(){ } Else{ } */
Int number1 or num1; Int add(int num1,int num2); Char choice = ‘+’; Int setX(int num){} Int getX(){}
import java.util.Scanner; public class Input { int num; char choice; float decimal; String name; num = inputScanner.nextInt(); //integer input choice = inputScanner.next().charAt(0); //character input decimal = inputScanner.nextFloat(); //float input name = inputScanner.next(); //string input //simply priting values }//end main }//end class
nextInt()
for integer, next().charAt(0)
for characters, next()
for strings. Then we are simply displaying these values to check whether the variables got the required input or not.
We will learn more coding in next tutorials.
If you have any questions or want to learn programming from me simply add me on skype
Username: mkprogrammer2121