Singlton Pattern In Scrabble give to sets of 7 random letters in one instance | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Singlton Pattern In Scrabble give to sets of 7 random letters in one instance

Hello, I copied this code form you tube, the link is in the comment, Idk if I have a syntax error, Or sololearn dosent support those libraries https://code.sololearn.com/cKAXE5c2iVbD/?ref=app

25th Apr 2020, 8:32 PM
Leonardo Monterey
Leonardo Monterey - avatar
7 Answers
+ 2
Leonardo Monterey Ok. Just added some code as an example to get output. You can add more code from vedio to main method.. Edit: For more about pattern links see this.. https://www.sololearn.com/Discuss/2188780/?ref=app https://code.sololearn.com/cb913x5q5f2Q/?ref=app
25th Apr 2020, 9:34 PM
Jayakrishna 🇮🇳
+ 1
Hello Leonardo Monterey The import statements have to be above your class, not inside. import java.util.Arrays; public class Program{ And It looks like that you are missing some brackets. Maybe some are too much. Please check that every opening bracket { has also a closing bracket }
25th Apr 2020, 8:43 PM
Denise Roßberg
Denise Roßberg - avatar
+ 1
See the video again.. import stetements shloud be at start of code.. Make proper changes.. Ex: Remove 1st 3 lines of text and last 2 braces... Put this at last and run.. public class Program { public static void main(String[] args) { Singleton newins=Singleton.getInstance(); System.out.println(newins.getLetterList()); } } Leonardo Monterey Add this class. You get some output.... Remaining code you can add from 3rd page from link
25th Apr 2020, 8:52 PM
Jayakrishna 🇮🇳
+ 1
Leonardo Monterey I really suggest you to learn the basics of java. I outcomment your main method. But without main you can't run your program.
25th Apr 2020, 9:02 PM
Denise Roßberg
Denise Roßberg - avatar
0
I know nothing about Java,still I removed all the errors by following the basic syntax and reading them, and you just pasted it here thinking that we should remove those errors for you for something that you copied ?do you think we are robots ?
25th Apr 2020, 8:44 PM
Abhay
Abhay - avatar
0
I pasted it and It was all scrambled so, I spread it acording to the screen shots, alright, I will check my syntax again
25th Apr 2020, 8:49 PM
Leonardo Monterey
Leonardo Monterey - avatar
0
Alright, I think I cleared up the syntax, the program is running fine, except it returns no output
25th Apr 2020, 8:58 PM
Leonardo Monterey
Leonardo Monterey - avatar