Question
this program was created using java in the jgrasp interface. Write a 6 sentence summary of what the program is doing, and correct any errors
this program was created using java in the jgrasp interface.
Write a 6 sentence summary of what the program is doing, and correct any errors if any?
import java.io.*; //directory to all java.io classes on the classpath
import java.util.*; //allows us to access all the classes and methods
public class Doublespace{ //class name
static void doubleSpace(Scanner s, PrintStream ps) // creating a double space method. Scanner is s and Printstream is ps
{ // opening of double space method while(s.hasNextLine()){ // Creates a boolean ps.println(s.nextLine()); //this returnes the strings of the current line ps.println(); // prints blank line } // end of while method } //end of double space method public static void main(String[] args) { //creates a main method Scanner in = new Scanner(System.in); //creates a new scanner with the specified string object doubleSpace(in,System.out); // prints doubleSpace } //end of main method } // end of the class
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started