Question: import java.util.Scanner; public class ScannerDemo 2 { public static void main ( String [ ] args ) { int n 1 , n 2 ;
import java.util.Scanner;
public class ScannerDemo
public static void mainString args
int n n;
Scanner scannerObject new ScannerSystemin;
System.out.printlnEnter two whole numbers";
System.out.printlnseperated by one or more spaces:";
n scannerObject.nextInt;
n scannerObject.nextInt;
System.out.printlnYou entered n and n;
System.out.printlnNext enter two numbers.";
System.out.printlnDecimal points are allowed.";
double d d;
d scannerObject.nextDouble;
d scannerObject.nextDouble;
System.out.printlnYou entered d and d;
System.out.printlnNext enter two words:";
String word scannerObject.next;
String word scannerObject.next;
System.out.printlnYou entered
word and word;
String junk scannerObject.nextLine; To get rid of
System.out.printlnNext enter a line of text:";
String line scannerObject.nextLine;
System.out.printlnYou entered: line ;
display look at lines But, please analyze the code before you compile and run it If possible, explain each line to your classmate sitting next to you or in the breakout roomTry not to look at the output on the next page of the textbook. Take turns with each line, so both of you get to share. Write down any questions you had about the code in this Display. If you have no questions, write, WeI had no
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
