CS61B Style Guide
Author: Paul Hilfinger

Checking Program Style with style61b

On the instructional machines, you can run our version of the open-source checkstyle program with the command

 style61b FILE.java ...

where FILE.java... denotes one or more names of Java source files. The program will exit normally if there are no style violations, and otherwise will exit with a non-zero exit code.

Style61b' is a simple script that invokescheckstyleconfigured with our official style parameters. For home use, it is included in our cs61b-softwarepackage. The rest of this document details the style rules thatstyle61b` enforces.







Assorted Java Style Conventions

Avoiding Error-Prone Constructs


The CS 61B IntelliJ Plugin

In Lab 2 you should have installed the CS 61B plugin, which allows you to locally check style in IntelliJ. If you have this plugin installed, you can check the style of your code files by right clicking on a file in IntelliJ and clicking the "Check Style" option.