TestReturnStatement

TestReturnStatement - return 2 z else return 4 System.out.println(z/Error This statement cannot be reached public static int (int z int a i a = z a

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

View Full Document Right Arrow Icon
public class TestReturnStatement { public static void main (String[] args) { funcReturnStatementError(3); } public static int funcReturnStatementError(int z) { return z; System.out.println(z); //Error: This statement cannot be reached } public static int funcReturnStatementError1(int z) { if (z < 3)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: return 2 * z; else return 4; System.out.println(z); //Error: This statement cannot be reached } public static int funcReturnStatementError2(int z) { int a; i a = z; a return 2 * a; r System.out.println(z); //Error: This statement cannot be reached return z; } }...
View Full Document

This note was uploaded on 06/17/2011 for the course COMP 2301 taught by Professor Staff during the Spring '10 term at Kennesaw.

Ask a homework question - tutors are online