I have a serious question...
I come without any prior knowledge in programming or computer science, I started to learn here on codegym and everything went surprisingly smooth and it felt even too easy to be true ( lol ).
Like we learned how to declare different types of variables like int, string, etc.
and then out of nowhere we are starting to write methods, classes?
Like how can we know for example how methods work, which are built in? how to understand them or what do they do.
we started declaring new objects ( which is almost self explanatory ) and so on..
now I truly can't understand what the codes in front of me mean and it happened also on the previous task and it continues on the next quests ( level 3, lesson 5 -
"Practice with variable visibility").
For me it feels like the course is heading way faster than it should... like how can we start speaking about OOP before understanding the basics of the language?
package en.codegym.task.jdk13.task04.task0402;
/*
Price of apples
*/
public class Solution {
public static void main(String[] args) {
Apple apple = new Apple();
apple.addPrice(50);
Apple apple2 = new Apple();
apple2.addPrice(100);
System.out.println("Apple price " + Apple.applePrice);
}
public static class Apple {
public static int applePrice = 0;
public static void addPrice(int applePrice) {
System.out.println("Parameter applePrice: " + applePrice);
System.out.println("Class variable Apple.applePrice before addition: " + Apple.applePrice);
Apple.applePrice = Apple.applePrice + applePrice;
System.out.println("Class variable Apple.applePrice after addition: " + Apple.applePrice);
}
}
}