0

Screenshots-getting missing parentheses error

import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner read = new Scanner(System.in); String name = read.next(); //screenshots ScreenShot screenshot1 = new ScreenShot(String c); ScreenShot screenshot2 = new ScreenShot(name); //outputting the names System.out.println(screenshot1.getName()); System.out.println(screenshot2.getName()); } } class ScreenShot{ private String name; //complete the first constructor ScreenShot(String c){ c = "Screenshot"; this.setName(c); } //complete the second constructor ScreenShot(String name){ this.setName(name); } //Setter public void setName(String name){ this.name = name; //Getter public String getName(){ return name; } }

16th Nov 2021, 10:43 PM
Natanael
1 ответ
0
Natanael You missed closing bracket after setName
16th Nov 2021, 11:26 PM
A͢J
A͢J - avatar