---
title: "how to send value from one class into different classes(more than one class)"  
description: "how to send value from one class into different classes(more than one class)"  
author: "Anonymous User"  
published: 2013-05-15  
updated: 2013-05-15  
canonical: https://www.mindstick.com/forum/882/how-to-send-value-from-one-class-into-different-classes-more-than-one-class  
category: "java"  
tags: ["java"]  
reading_time: 1 minute  

---

# how to send value from one class into different classes(more than one class)

Hi Everyone!\
I have [value](https://www.mindstick.com/articles/23219/an-optimized-description-adds-value-to-experience-and-in-turn-effectively-guest-posting-packages) strUser and KEY ,I want to send this value to [multiple](https://www.mindstick.com/blog/12797/iowa-is-expected-to-see-heavy-growth-in-multiple-sectors) different classes because this value will be used in 5 classes for [url](https://www.mindstick.com/forum/436/url-redirection), I know the way to send value to one [class](https://www.mindstick.com/blog/165/generic-class-in-c-sharp) only using [Intent](https://www.mindstick.com/forum/33890/examples-of-intent-and-bundles).putExtra as bellow :\
Intent [policy](https://yourviews.mindstick.com/view/247/no-fail-policy-failing-its-purpose)= new Intent(LoginActivity.this,EpolicyListPolis.class); policy.putExtra("etUser",strUser); policy.putExtra("key",KEY); startActivity(policy);How can I send this value to multiple different classes at a time? can i use SharedPrefences..? how the way i write sharedPrefences in class and my [destination](https://yourviews.mindstick.com/story/1451/gorgeous-locations-for-destination-weddings-in-india) class?\
Thanks in [advance](https://www.mindstick.com/blog/33258/jee-mains-and-jee-advance-exams)!

## Replies

### Reply by AVADHESH PATEL

Hi Jeet!\
Try as following\
send value from this class with Intent....\
Intent policy= new Intent(LoginActivity.this,EpolicyListPolis.class); policy.putExtra("key",strUser); startActivity(policy);\
this works like: KEY-"key" and VALUE-strUser. and you get this value from another class using KEY.\
Get value like this.\
String user = getIntent().getExtras().getString("key",null);in user you get strUser value. and if strUser not pass any value than default null(right side of "key") assign for user....\
same you use from all class you need... but remember all works with KEY...\
because KEY(one type of ID) is only which is works to Put and Get particular value.....\
I hope it helpful for you!


---

Original Source: https://www.mindstick.com/forum/882/how-to-send-value-from-one-class-into-different-classes-more-than-one-class

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
