VarsAndBranches - { int num = 3, negNum = 0; // Statements...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
// File: VarsAndBranches.java // Author: Amber Settle // Purpose: To demonstrate how branches can complicate the use of // variables and the solutions to the problems that arise / public class VarsAndBranches { public static void main(String[] args)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: { int num = 3, negNum = 0; // Statements here to change the value of num // Without those statements, we see that num is positive if (num > 0) { negNum = -num; //System.out.println(negNum); } System.out.println(negNum); } }...
View Full Document

This note was uploaded on 03/05/2011 for the course CSC 211 taught by Professor Chan during the Spring '11 term at CA Health Sciences.

Ask a homework question - tutors are online