It will compile and print 30.
But answer is mentioned as Compilation error.
About Question enthuware.ocpjp.v11.2.1770 :
Moderator: admin
-
- Posts: 2
- Joined: Mon May 30, 2022 1:48 pm
- Contact:
-
- Site Admin
- Posts: 10053
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v11.2.1770 :
Please make sure you have copied the code exactly as given.
If you like our products and services, please help us by posting your review here.
-
- Posts: 10
- Joined: Wed Nov 23, 2022 3:40 am
- Contact:
Re: About Question enthuware.ocpjp.v11.2.1770 :
This question is not correct, please review it. It gives no compilation error and as mentioned that interface's variables are never inherited and can be accessed only by the name of the interface class.
-
- Site Admin
- Posts: 10053
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v11.2.1770 :
Again, the question and the given answer/explanation are correct. Copy the code exactly as given and try compiling it from the command line.
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 44 guests