Intro to FRC Programming - Romi
  • INTRODUCTION
    • Overview
    • Important Links
  • 💽Setup
    • Setting up the Romi's Software
    • Downloading Essential Tools
    • APCS vs FRC
  • How To Code in VSC
    • VSC- Intro
    • A Tour Through VSC
    • Creating a Regular Java Project
  • Intro to Java
    • What is Java?
    • Beginning Steps
    • 🟩Fundimentals of Java
      • Variables
      • Operations
      • Methods
      • Comments
      • If Statements and Conditions
      • Boolean Zen
      • Loops
      • Challenge- Create a Box House
    • 🟨Advanced Concepts
      • Objects
      • Scanners
      • Null Objects
      • Arrays
      • Errors
      • For-Each Loops
    • 🟥Object Oriented Programming
      • Basics of OOP
      • Instance Classes
      • Static Classes
  • 🕑Romi Curriculum- Timed Base
    • Romi Curriculum- Introduction
    • Creating a WPILIB Project
    • Running Your Code
    • The Robot Class
    • Subsystems
      • RomiDrivetrain
    • Cool stuff i will rename this category later
      • Spark Motors
      • PIDs
      • External Controllers
      • Encoders
  • 🖥️Romi Curriculum- Command Based
    • Command Based Code
    • RobotContainer
    • Commands
    • CommandScheduler
  • UNRELATED IMPORTANT CODING KNOWLEDGE
    • Constants
  • SAMPLE CODE
    • Tank Drive Example
      • RobotContainer
      • TankDriveSubsystem
      • MoveRobotCommand
    • Worktop Systems Sample Java Code
      • Belt Elevator Sample Code
      • Rotating Arm Sample Code
Powered by GitBook
On this page
  • Syntax Errors
  • How to Solve Them
  • Runtime Errors
  • Logic Errors
  1. Intro to Java
  2. Advanced Concepts

Errors

PreviousArraysNextFor-Each Loops

Last updated 2 months ago

Throughout your coding experience, you'll experience countless errors. It's just a part of life as a programmer. There's 3 types of errors that you'll experience:

Syntax Errors

These errors are caused by incorrect formatting or spelling (e.g., a missing semicolon at the end of a line) and prevent your code from running at all.

How to Solve Them

Compilers automatically underline typos with a red underline, like in the example below.

Runtime Errors

These errors are caused when a program attempts to run a line of code that the compiler considers impossible or invalid.

For example, let's say you tried to divide something by 0. Your code will automatically stop running, and give you a runtime error.

Since there are so many different sources of runtime errors, when a Runtime Error is called, the code will specify why. For example, if you try to do something with a null object (like add a value, check if it's equal to a boolean, etc.) , it will give you a NullPointerException.

Logic Errors

Although these don't stop your code, in some cases they're even worse than the other two.

🟨