This week's book giveaway is in the XML and Related Technologies forum.
We're giving away four copies of Java XML & JSON and have Jeff Friesen on-line!
See this thread for details.
Win a copy of Java XML & JSON this week in the XML and Related Technologies forum!
  • 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
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Different way to instantiate the objects in Android Java  RSS feed

 
Ranch Hand
Posts: 86
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
 
Master Rancher
Posts: 3887
45
  • 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.
 
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!