#Write a method which takes String parameters and returns an ArrayList
30 messages · Page 1 of 1 (latest)
Hey, @sterile fjord!
Please remember to /close this post once your question has been answered!
<@&765578700724371486>
Have an exam on this in 3 hours btw, other class starts in 2
@plucky olive are you able to help with this ?
What have you trued so far?
or what is the problem?
Do you know what methods are?
Right now no
Tired, burnt out
Usually when I do something with a method it's just type one thing, click red light bulb, have intelliJ generate it for me then type more
Tried this earlier:
String first = "first";
...
ArrayList<String> littleList = new ArrayList<>();
littleList.add(first);
Few other things too but I can't remember them
@woven fossil
Is private static .. to the } all the method
Or is it just the top line from private to {
Main issue that started my confusion was the "focus on the header"
.
Got focused on the rest of it and forgot it said that but was fixated on that point of it
Im not sure what part of it that you don't understand
Header
"Private static pill..."
Usually don't write them, just write the stuff in them and let intelliJ make the headers if it wants to
Private means that method is only Useable in that class, static means that method is a static method ( This need google because explain it gonna take a bit of times ), pill is the class name
Public ArrayList<> littleList(String example1, String example2, String example3) { I think this is what its asking, could be wrong? Im learning still too
It"s right but the return typr is ArrayList<String>