I'm trying to change the color of specific text in Eclipse's console, for example: regular text is in black, but errors are presented in red color. I'm trying to do the same with the try and catch blocks. Here's my code:
int [] arr = {1,2,6,8}; try { for (int i = 0; i < 9; i++) { System.out.println(arr[i]); } } catch (Exception ArrayIndexOutOfBoundsException) { **System.out.println("You got too long");** } Now I want the code surrounded by double asterisks to be in red color in the console, is it possible? and if yes then how? Thank you.
System.err.println.