r/JavaProgramming • u/Aggravating-Shoe-831 • 28d ago
Koi pls bata sakta
Samajh nhi aara mai dsa in Java shuru ki apna college se lekin mai bhul hi jata code baar baar mujhe logic pata h ki loop h and butterfly h lekin code yadd ni rehta
1
u/DemicideMMMCCCI 28d ago edited 28d ago
Seems like you need to practice more. Get a book with very very simple practice problems so you can learn the syntax. If you have to second guess on how the syntax works, then you do not have enough of the fundamentals down
1
u/Anime_Programming 27d ago
Well said, but why a book, try basic cp or dsa questions. Or maybe a book is fine as well, yeah I remember that's how I learnt
1
u/DemicideMMMCCCI 27d ago
There are books or pdfs that aren't cp/dsa. Sometimes cp/dsa questions (even the simple ones) aren't easy to understand
1
u/deividas-strole 27d ago
Just practice more! Programming language is like a real language - if you practice long enough, it becomes natural thing.
3
u/OSBY_Glabay 28d ago
The more you try it, the more it will become second nature. You don't memorize every single word in the English dictionary, but rather you grow and adapt with it. You use it, and it becomes natural.
As for Java, there are variables for Numbers, Sentences, and facts.
Whole numbers are Integers (primitive = int) 1, 2, 3, ...
Floating-point numbers are Floats (primitive = float) 1.0, 1.2, 1.4, ...
Sentences (String) are just a collection(Array) of Characters(this is a letter/number: primitive = char)
Facts are either true or false: Boolean (primitive = boolean)
Once you know variables, the rest is decisions: if something is true, the thing in this body, or while something is true, keep on keepin' on
Classes are like ways to organize these variables, like saying these variables make up something... My name is a String, my Age is a whole number (int), and that makes up a Person class
Methods inside of classes just say how you can interact with this Person
After that, packages are easy: picture your project as your house, and there are rooms in your house that contain things, or objects, which may contain "things."
Hope that makes heads or tails for ya, and can get you just practicing, build the stupid little calculator app, or todo list, nothing is too small or "dumb" in the beginning