• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Doubt on visibility of business methods

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 329
Oracle Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Nicolas,



Method m2() in interface MyI is public!! Remember, methods in interfaces are public by default (in fact they can only be public).
 
I am not a spy. Definitely. Definitely not a spy. Not me. No way. But this tiny ad ...
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic