And, if it is not the static block but a non-static block, the error is ArrayIndexOutOfBoundsException. So, does Oracle or others expect us to know that? How does it benefit anybody?
class Ax {
int [] x = new int[0];
{
x[0] = 1;
}
}
About Question enthuware.ocajp.i.v7.2.1326 :
Moderator: admin
-
- Posts: 8
- Joined: Tue Jan 11, 2022 4:41 am
-
- Site Admin
- Posts: 10062
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1326 :
Hi Sijucm,
Our job is to prepare you for the exam. We we get into the argument of what is and what is not useful, we will not be doing that job well. But I understand your concern and rest assured that you are not alone. Many people have the same complaint. The right forum to raise your concern might be twitter or some other social media network.
Here, we try to keep the discussion focused on the task at hand, i.e., learning what we need to learn for passing the exam.
HTH,
Paul.
Our job is to prepare you for the exam. We we get into the argument of what is and what is not useful, we will not be doing that job well. But I understand your concern and rest assured that you are not alone. Many people have the same complaint. The right forum to raise your concern might be twitter or some other social media network.
Here, we try to keep the discussion focused on the task at hand, i.e., learning what we need to learn for passing the exam.
HTH,
Paul.
If you like our products and services, please help us by posting your review here.
Who is online
Users browsing this forum: No registered users and 49 guests