Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • I need all consts of 'NewDeviceDetailsConsts', in around 10 classes,which one will you suggest ? Commented Jun 4, 2016 at 19:12
  • Seeing as how you need to reference the objects in multiple classes, create the getters in your Template class. This will allow you to access the objects no matter what class you're working in. Commented Jun 4, 2016 at 19:14
  • I came up with this import static Templates.NewDeviceDetailsConsts.*. I will use this and use the Consts directly. Is this approach better or should I go with getters ? Commented Jun 4, 2016 at 19:55
  • @tarun14110 that approach works perfectly well. The only drawback is you will have to add that at the top of each file, otherwise it's completely acceptable. Commented Jun 4, 2016 at 19:56