• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Ron McLeod
  • Tim Moores
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Vijitha Kumara

Different way to instantiate the objects in Android Java  RSS feed

 
Ranch Hand
Posts: 88
Android
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi There I have one question if anyone helps me to understand or provide me some kind of link

ContentValues cv = new ContentValues() ;

I have the idea what this line of code is doing but I am confused in this line

FingerprintManager fm = (FingerprintManager) getSystemService(SERVICE_FINGERPRINT);

I wanna know where we use (FingerprintManager) or other objects

if anyone explains to me why we use (OBJECT) int bracket to instantiate the object.

Thanks
 
Rancher
Posts: 3983
47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
getSystemService() is simply returning a value (some form of service) based on the value passed in.
It's quite likely it is not actually instantiating anything.

In the simplest form, it might be accessing a Map<Integer,Service>, where Service is some standard interface and returns the value with a matching key.
 
Get me the mayor's office! I need to tell her about this tiny ad:
global solutions you can do in your home or backyard
https://coderanch.com/t/708587/global-solutions-home-backyard
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!