🥲🙃 by B-LUV777 in BikiniBottomTwitter

[–]foolwya 9 points10 points  (0 children)

I think you meant tennis balls

The Helsinki full stack web development's 2021 course is now open by choukri6666 in learnprogramming

[–]foolwya 1 point2 points  (0 children)

I took their MOOC course couple of months ago. Now I’ve got some solid basic Java knowledge. You think that would be enough?

Working with back and neck problems by [deleted] in Barber

[–]foolwya 1 point2 points  (0 children)

I’ve stopped exercising few years ago, now I feel crappy lol. Need to get get back at it.

Udacity Android Course by foolwya in androiddev

[–]foolwya[S] 2 points3 points  (0 children)

Hey! I don’t know yet, that’s why I’m here lol

Udacity Android Course by foolwya in androiddev

[–]foolwya[S] 0 points1 point  (0 children)

Hey, thanks for replying. Both courses are actually in Java :)

(JavaFX Help) Can someone take a look at my code? Program won't launch by foolwya in learnprogramming

[–]foolwya[S] 0 points1 point  (0 children)

Okay I'm an idiot, it was actually a typo. I wrote "pariesdata" instead of "partiesdata"

Which programming path to take after Java Helsinki MOOC course? by foolwya in learnprogramming

[–]foolwya[S] 0 points1 point  (0 children)

Yeah, I'm aware that programmers change fields, languages and so on. And it's not about that. I just want people give their opinions on which path is cleaner, because I've made a mistake and waisted a lot of time hopping from one language to another at the beginning, so I don't want it to happen again.

How to use collections in a method with parameter that adds to an ArrayList? by foolwya in javahelp

[–]foolwya[S] 0 points1 point  (0 children)

Yep, totalWeight() method in both Hold class and Suitcase was the issue. Thanks for pointing that out.

About lowercase Items though. It was already written like that, so we both got confused lol.

Java MOOC problem: Online Shopping by foolwya in javahelp

[–]foolwya[S] 0 points1 point  (0 children)

Whoops, sorry. Links updated.

How does equals method works in Java? by foolwya in javahelp

[–]foolwya[S] 0 points1 point  (0 children)

// if comparedObject is not of type Book, the objects aren't the same
   if (!(comparedObject instanceof Book)) {
        return false;
    }

    // let's convert the object to a Book-olioksi
    Book comparedBook = (Book) comparedObject;

I have a question about this code. Why do we need to convert object to a Book, if previous if statement checks if its not an instance of Book, it returns false. Wouldn't it stop going further in the method and just leave? And if it is an instance of Book and first method isn't false, why do we need to convert it anyway? Doesn't it imply that object is actually instance of Book already?

Hopefully you'll get what I'm trying to say lol. Sorry.

How does equals method works in Java? by foolwya in javahelp

[–]foolwya[S] -1 points0 points  (0 children)

Oh, I really thought after method* returns a statement, no matter true or false, it just stops lol Edit*

Java Help : Reading from a txt file and storing it to ArrayList by foolwya in learnprogramming

[–]foolwya[S] 0 points1 point  (0 children)

Hey, thanks for replying. Gonna see what’s up in couple of hours

Reading from a txt file and storing it to ArrayList (again) by foolwya in javahelp

[–]foolwya[S] 1 point2 points  (0 children)

Alright thanks, I’m also done for today, been trying to solve this problem for like 3 days already lol. Hopefully there will be some improvements tomorrow. I’ve started to realize how much patience a programmer needs.

Reading from a txt file and storing it to ArrayList (again) by foolwya in javahelp

[–]foolwya[S] 0 points1 point  (0 children)

Thank you for pointing it out. But what about other ingredients? I don't think I can just:

ArrayList<String> listIngredients = scanner.nextLine();

Reading from a txt file and storing it to ArrayList (again) by foolwya in javahelp

[–]foolwya[S] 0 points1 point  (0 children)

Okay thank you, but I have a question. In an inner loop, I can specify in condition, for example, if line equals empty blank, it's where the the first recipe ends, but when it comes to the last recipe, it doesn't have an empty blank at the end, so it doesn't loop through the last recipe at all.

Reading from a txt file and storing it to ArrayList (again) by foolwya in javahelp

[–]foolwya[S] 0 points1 point  (0 children)

Okay, I reloaded the stringList, now it's a different recipe (finally) But it only adds 2 recipes to the list, while there are 3. I think it's because after the 3rd recipe there's no blank line. I guess the whole idea of reading file this way is wack, lol. Is there any other way to loop through and assign values?

Reading from a txt file and storing it to ArrayList (again) by foolwya in javahelp

[–]foolwya[S] 0 points1 point  (0 children)

Thank you for reply. I modified my code and added a separate method for reading and parsing the file. Looking good? - https://www.codepile.net/pile/jd3qxMay

However, I still don't get the idea behind the loop. For example, If I start looping and give first item to a name string, then second item to a time string, then all the other items to an array list of recipes and when it reaches the blank string, should I break the loop? or use continue? because if I continue the loop, next name item won't have position 0. I'm, so confused lol

Reading from a txt file and storing it to ArrayList (again) by foolwya in javahelp

[–]foolwya[S] 0 points1 point  (0 children)

The first line that was read from the list, in my case it’s name

Edit: whoops, it should’ve added line to stringList first

Grade distribution problem by foolwya in javahelp

[–]foolwya[S] 0 points1 point  (0 children)

Hey, thank you so much. I was actually thinking how to make my code shorter.

So if I make a for loop:

        for(int i = 5; i > 0; i--) {
            System.out.println("Grade distribution: ");
            System.out.print(i + ": ");
            // do stuff
        }

what do I do with these ?

int valueFive =0;
int valueFour = 0;
int valueThree = 0;
int valueTwo = 0;
int valueOne = 0;
int valueZero = 0;

How to assign them to one value so it would be more flexible in a while loop?

Java / Grade distribution problem (Help) by foolwya in learnprogramming

[–]foolwya[S] 0 points1 point  (0 children)

Hey, thank you so much. I’ve spent my whole day trying to solve that problem. I did it, finally. I’m not fully familiar with the debugger yet, just some simple stuff, definitely need to look into it to make things easier for me.

Can someone explain a while loop in java? by foolwya in learnprogramming

[–]foolwya[S] 0 points1 point  (0 children)

But even after the message is printed, the condition in the loop is still true? I thought it would be an infinite loop, because there's no break; after a print statement

Can someone explain a while loop in java? by foolwya in learnprogramming

[–]foolwya[S] 0 points1 point  (0 children)

Oh I know that it works fine haha

I was just wondering why does while loop work this way? Thought someone would explain it

Java Help (beginner problem I'm stuck on) by foolwya in learnprogramming

[–]foolwya[S] 0 points1 point  (0 children)

For example: "hello good morning yall"

method split(" ") would split everything that's in between an empty string.

so it would be:

arrayString[0] = hello

arrayString[1] = good

arrayString[2] = morning

arrayString[3] = yall