errors and debugging

5
Errors and debugging

Upload: tegan

Post on 05-Jan-2016

21 views

Category:

Documents


2 download

DESCRIPTION

Errors and debugging. Introduction. Even the best coders make mistakes. In this presentation you will see what the main errors in Java are and how to solve them. There will be a few short videos to demonstrate some of the ideas. What is an error?. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Errors and debugging

Errors and debugging

Page 2: Errors and debugging

Introduction

Even the best coders make mistakes. In this presentation you will see what the main errors in Java are and how to solve them.

There will be a few short videos to demonstrate some of the ideas.

Page 3: Errors and debugging

What is an error?

When your code does some thing that was unexpected this is known as a error.

If your code does not compile then the problems are also classed as errors.

Errors can be split into three main types - Syntax errors Logic errors Run time errors

Page 4: Errors and debugging

Syntax errors

A syntax error occurs when you make grammatical errors in your source code.

This is commonly typing mistakes or forgetting to balance your brackets.

If code has a syntax error in it then it will not compile.

Page 5: Errors and debugging

Retake code

The code is a direct representation of the tree -

if (mark<50){

if (exams<4){

System.out.println(“Do retake now”);} else {

System.out.println(“Do retake later”);}

} else {

System.out.println(“No retake”);}