Write the definition of a method named copy receives a


Write the definition of a method named copy receives a reference to a Scannerobject associated with a stream of input. The method reads all the Strings remaining to be read from the stream and displays them, one on a line with no other spacing, onto standard output .

this is my code, it doesn't work:

public static void String copy(Scanner obj){

String str1;

String str2;

if(!obj.hasNext()){

str2 = copy(obj);

str1 = obj.next();

System.out.println(str2);

}

}

 

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Write the definition of a method named copy receives a
Reference No:- TGS0662485

Expected delivery within 24 Hours