-
-
Save uncoded-ro/6cc48ec813883ed5b8fff71e0173d5c7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ro.virtualcampus.exceptii; | |
public class Exceptie2 { | |
public static void main(String[] args) { | |
int tablou[] = { 2, 4, 5, 1 }; | |
int index = 3; | |
if (index >= tablou.length || index < 0) | |
System.out.println("indexul [" + index + "] depaseste marginile tabloului"); | |
else | |
System.out.println("elementul tablou[" + index + "] este " + tablou[index]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment