+ 3

How can i compare types Scanner and String in Java? How do i make a String from Scanner? [SOLVED]

11th Nov 2018, 11:15 AM
kritomas
kritomas - avatar
3 Answers
+ 17
Do you mean how to gain input? Scanner sc=new Scanner(System.in); String str=sc.nextLine(); Compare types of Scanner: System.out.println (sc instanceof Scanner);
11th Nov 2018, 1:08 PM
Muhd Khairul Amirin
Muhd Khairul Amirin - avatar
+ 18
don't forget import statement 😅 //import java.util.Scanner;
11th Nov 2018, 1:16 PM
Gaurav Agrawal
Gaurav Agrawal - avatar
- 1
hey
17th Nov 2018, 12:48 PM
Laabidy chiheb
Laabidy chiheb - avatar