0

what does e.close(); do?

what is the work of e.close(); ?? In this example code, there are no work of e.close(); but what about others? when to use it? and for what? I need a good explaination ☺ Example : import java.util.Scanner; public class GetEqual{ public static void main(String[]args){ int a,b,sum; Scanner e=new Scanner(System.in); System.out.println("Enter 1st Num : "); a= e.nextInt(); System.out.println("Enter 2nd Num : "); b=e.nextInt(); e.close(); sum=a+b; System.out.println("Answer is : "+sum); } }

22nd Apr 2018, 2:30 PM
RH Tasin
RH Tasin - avatar
1 Resposta