+ 3

Fill the blank plz..

public static class A{ void print (______ a) { System.out.print(a); }} public static void main(string[] args) { Scanner in = new Scanner(System.in); A a = new A(); a.print(in.nextLine()); }

11th Sep 2017, 1:41 PM
Bhumika
Bhumika - avatar
3 Respuestas
+ 10
import java.util.Scanner; public class A { void print (String a) { System.out.print(a); } public static void main(String[] args) { Scanner in = new Scanner(System.in); A a = new A(); a.print(in.nextLine()); } } /* Remember: You cannot make the top-level-class static. You can only make a nested class static. https://stackoverflow.com/questions/15448352/why-is-class-declared-as-static-in-java There seem to be many typos in your code as well, and that's my best attempt to make it work seamlessly ;D */
11th Sep 2017, 1:56 PM
Dev
Dev - avatar
+ 4
Is it static? Double? I dunno. My gueses on seeing 6 blanks
11th Sep 2017, 1:49 PM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 4
/* Oops I did not realise there is a string option lol */
11th Sep 2017, 2:00 PM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar