Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

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).
 
this is supposed to be a surprise, but it smells like a tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic