How to use scanner in java?
import java.util.Scanner;
class classname{
public methodname(){
//Scanner declaration
Scanner s_name = new Scanner(System.in);
//Use Scanner to take input
int val = s_name.nextInt();
}
}
| Is This Answer Correct ? | 0 Yes | 0 No |
What Is Resource Leak?
What does localhost mean?
Can we overload destructor in java?
can you create interface instance ?
Difference between ‘>>’ and ‘>>>’ operators in java?
What are the differences between the constructors and methods?
what is inner class?
Which one will take more memory: an int or integer?
What are Font and FontMetrics classes?
explain local datetime api in java8?
class A{ class B{ } } in which name u save the file,its the program compile?
Explain the difference between arraylist and linkedlist in java?