0
How to put scanner in abstract class? Using java.
I am a beginner please help me. Thanks.
1 Answer
+ 1
You need in abstract class which will belong to the class rather then the instance's of this class.
static Scanner sc = new Scanner(System.in);
This way all instances will share the same scanner.