Categories
Blog

A Few Java Factoids – Part 1

A few basic facts about Java.

This is the main method that you’re going to use every time you run a Java program, unless you’re making just a class file, in which case you will not need the whole public static void main (String[] args), but you will still need [class] with the class name next to it.

Brackets or the curly braces (what have you) that look like this { } are required at the beginning and end of each method you’ve used to indicate when you’ve finished the programming statements for that particular method.

Finally, for each System.out.println("Text"); that you have there always needs to be a ; at the end. Always! So get used to it!

If you decide NOT to put the stupid ; at the end of your output statements, you WILL get an ERROR.

Also, in case you were wondering, with most IDEs or Integrated Development Environments, there is syntax highlighting which makes it easier to understand what’s going on by adding color to the types of different texts.

For example, with the Strings involved in the program, they are the color [red]. With the comments involved in the program, they are the color [gray]. Different methods are highlighted in [blue].

So that’s pretty much it for the super duper basics of any Java program.

Remember, you gotta have your:\

  1. main method public static void main (String[] args)\
  2. curly braces {}\
  3. semi-colons ;\
  4. comments to explain what the heck you’re doing in the program such as [//single-line stuff] or [/*multi-line stuff*/]

Get it? Got it? Good.

By Frances Coronel

Frances Coronel is a software engineer specializing in UI development on the Customer Acquisition Team at Slack where her mission is to make your working life simpler, more pleasant, and more productive.

She has been working professionally as a developer since 2015 and holds a Bachelors in Computer Science from Hampton University and a Masters in Computer Science from Cornell Tech.

Outside of Slack, Frances is an Executive Director of Techqueria, a 501c3 nonprofit that serves the largest community of Latinx in Tech in the US.

She also supports Code Nation as a member of their Bay Area Leadership Council and the Latino Community Foundation as a member of their Latinos in Tech Giving Circle.