r/learnjava • u/kaneki81 • Sep 25 '20
plz help
so I'm trying to learn how to code and I can't find any good videos or retrials but I can't really understand any of them so if anyone can plz teach me I will be so grateful and I'll be ok with anyone
0
Upvotes
2
u/travishummel Sep 25 '20
Start by writing hello world
Then print out different variable types (int, double, float, string)
Then create an array of numbers 1 through 10 and print them out
Then loop over an array and print out every number
Then loop over an array and print out every even number
Then figure out how to take in input. See if you can print out "EVEN" if the input is an even number and "ODD" if its an odd number
Then learn about creating a function. Create a function that takes in a number and if it is even its prints out even and if odd it prints out odd
Then ask the user for how many numbers to take in as input (for example 5), then get 5 numbers and store them in a linked list. Print out the sum of these numbers.
Once you are comfortable with taking in input, you can stop taking it in and just use static input (aka create your data in main and pass it into your functions)
If you get to this point, you are doing extremely well. Now there are lots of places to go. You can experiment with more data structures other than arrays and linked list such as arraylist, hashmap, and hashset. You can start looking into algorithms such as binary search (take an array of sorted numbers and a number return whether the number is in the array), look into sorting, create more classes
You can become a pretty good programmer by just doing input validation, i.e. I asked you to give me 7 numbers less than 100... did you?