+ 2

When to use brackets?

I recently decided to try out Java after getting fairly good at python, and all of the curly brackets, parentheses, and semi colons are making me want to explode. It makes sense when I look at Java code, but when I go to do it myself it just looks like a mess. Does anybody have any tips on these sort of things?

19th Feb 2018, 10:52 PM
Bridgetn58
Bridgetn58 - avatar
2 Answers
+ 2
I'm new to both python and java, but maybe this will help create a foundation: brackets enclose classes, methods, if statements, loops parentheses enclose method arguments semicolons mark the end of statements in classes and methods there's certainly more information to be known, but that's what I know so far. I hope it's at least a start.
19th Feb 2018, 11:17 PM
k.leonard@snhu
k.leonard@snhu - avatar
+ 3
lol. i felt crazy when i started to learn python that doesn’t have curly brackets {} and semicolons ;;;; javascript, c, c++, java, c# all have curly brackets to structure the code. the tip is in the place where in python you indent the code you need to put the curly bracket in java, hope it helps
11th Aug 2018, 7:59 PM
wave rider
wave rider - avatar