2/1/2025 ----------- Q)What is the main purpose of an computer program(application)? =>data processing. Q)Can data be processed without storing in RAM(Random Access Memory)? =>No. =>Data should be stored in primary memory/main memory/RAM in order for processing. Q)How to store data in RAM in a Java application? =>By using variables Q)What is a variable? =>Named memory location is nothing but a variable. =>Programmers treat a variable as a container to store data in RAM. =>The content of a variable can vary and hence the name. Q)How declare a variable in a Java application? OR Q)What is the syntax to declare a variable in a Java program? ; For eg. int a; Q)What is meant by assignment in the context of a variable? =>Assigning a value to a variable is nothing but assignment. I.e. storing a value into the variable is nothing but assignment. For eg. a=10;//assignment a=40;//assignment Q)What is meant by initializing a variable? =>Assigning a value to a variable for the first time is known as initializing the variable. For eg. int a;//variable declaration a=10;//initializing the variable a=50;//assignment Q)What is meant by defining a variable? =>Variable declaration and initialization if happens in a single statement, it is known as defining the variable. For eg. int a=10;//defining the variable Q)Java program to define two integer variables, add them and display the sum. //Addition.java class Addition{ public static void main(String args[]){ int n1=10; int n2=20; int sum=n1+n2; System.out.println("The sum of "+n1+ " and "+n2+" is "+ sum); } }.