0

What's the problem?

public class Program { static String size; public static void main(String[] args) { size.set("small"); System.out.println (size); } }

16th Apr 2020, 7:50 PM
Yahel
Yahel - avatar
4 Respostas
+ 1
There is no set method defined in the class. Also you generally use that when setting field values for objects. In this case you could just simply write- size = "small";
16th Apr 2020, 7:58 PM
Avinesh
Avinesh - avatar
0
Avinesh ty, can you please give me a simple example when you use the "set" thing?
16th Apr 2020, 8:17 PM
Yahel
Yahel - avatar
16th Apr 2020, 9:22 PM
Avinesh
Avinesh - avatar
0
Avinesh thanks!
16th Apr 2020, 9:30 PM
Yahel
Yahel - avatar