Forums Register Login

Doubt on visibility of business methods

+Pie Number of slices to send: Send
Hello,

I have a doubt about a mock exam question.

According to the core specs (4.6.5) : the business method must be public.

Now the mock exam question:
Given the following interface:


Which method of the following bean are exposed to local clients ?:
[CODE]
@Stateless
public class MyBean implements MyI {
public int m1() { return 1; }
public int m2() { return 2; }
}

The answer provided says that both methods m1() and m2() are exposed to local client.

I had thought that since client acces bean via their interface, only m1() is exposed to local clients.

I assume the answer provided with the mock exam must be correct, but I have a doubt, because the spec is clear on this point.

Thanks for any input

Nicolas
+Pie Number of slices to send: Send
Hi Nicolas,



Method m2() in interface MyI is public!! Remember, methods in interfaces are public by default (in fact they can only be public).
pie. tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 617 times.
Similar Threads
Use of static in abstract class..
Dan's Exam Array Doubt
casting an int to a byte in the return statement
Interfaces doubt
Doubt regarding interface implementation
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 06:08:45.