24/12/24 ---------- Q)How to read data from the keyboard into a Java application? =>By using the library methods of Scanner class. Q)An application runs on which cycle? =>IPO(Input Process Output) The sum of 10 and 30 is 40 Q)Develop a Java application to perform the addition of two numbers. //Addition.jav a import java.util.Scanner; class Addition{ public static void main(String args[]){ Scanner scanner=new Scanner(System.in); System.out.println("Enter the first number:"); int n1=scanner.nextInt();//scanner.nextInf(); System.out.println("Enter the second number:"); int n2=scanner.nextInt(); int sum=n1+n2;//Processing System.out.println("The sum of"+n1+"and"+ n2 +"is "+sum); } } Note:- "+" operator acts as string concatination operator as well as arithmetic addition operator. =>When both the operands are numbers, "+" acts as arithmetic addition operator. =>When atleast one operand is a string, it acts as a string concatination operator. Q)What is an operator? How are operators classified? =>An operator is a symbol that acts upon data items known as operands in order to process them. =>There are 2 criteria for classifying operators. 1)based on the number of operands they are acting upon, operators are of three types. 1)unary(acts upon single operand) 2)binary(acts upon 2 operands) 3)ternary operator (acts upon 3 operands) =>On the basis of type of operation that they are performing, operators are classified as follows. 1)Arithmetic operators 2)Asignment operators 3)relational operators(comparision operaters) 4)Logical operators etc.