answersLogoWhite

0

How do you create a string reference?

Updated: 8/20/2019
User Avatar

Wiki User

12y ago

Best Answer

String strReference = new String();

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you create a string reference?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Does passing static strings as parameters to a method create a copy of the String or passes its reference?

Java always follows a pass by value approach.


What is inventory referencer c plus plus?

// Inventory Referencer // Demonstrates returning a reference #include <iostream> #include <string> #include <vector> using namespace std; //returns a reference to a string string & refToElement(vector<string>& vec, int i); int main() { vector<string> inventory; inventory.push_back( "sword"); inventory.push_back( "armor"); inventory.push_back( "shield"); //displays string that the returned reference refers to cout << "Sending the returned reference to cout:\n"; cout << refToElement(inventory, 0) << "\n\n"; //assigns one reference to another - inexpensive assignment cout << "Assigning the returned reference to another reference.\n"; string& rStr = refToElement(inventory, 1); cout << "Sending the new reference to cout:\n"; cout << rStr << "\n\n"; //copies a string object - expensive assignment cout << "Assigning the returned reference to a string object.\n"; string str = refToElement(inventory, 2); cout << "Sending the new string object to cout:\n"; cout << str << "\n\n"; //altering the string object through a returned reference cout << "Altering an object through a returned reference.\n"; rStr = "Healing Potion"; cout << "Sending the altered object to cout:\n"; cout << inventory[1] << endl; return 0; } //returns a reference to a string string & refToElement(vector<string>& vec, int i) { return vec[i]; }


How do you create a string and reverse a string in vb?

gov


Is string a value type or a reference type?

It can depend on what language you are using, but it's generally a reference type.


How do you do Jacob's Lader on string?

Jacob's Ladder is a classic string figure that involves manipulating a loop of string between the fingers to create a ladder-like structure. To create Jacob's Ladder, start with the string looped around both hands, then twist the loop around your fingers to create the ladder pattern. Follow a step-by-step video tutorial for detailed instructions on how to create Jacob's Ladder with a string.


What are two ways a string can b combine to create a new string?

twist it and weave it


What does the java new operator do?

The new keyword tells Java that you want to create a new instance of a class by invoking one of the constructors for that class.// Create a new, empty String objectString s1 = new String();// Create a new String object with a different constructorString s2 = new String("howdy");


How many violin strings are needed to make a musical composition?

To create a musical composition with a violin, only one string is ultimately necessary. You can create enough sounds with one string that you can create a composition with only one.


WHich string instrument can create the largest variety of sounds?

The harp has the broadest range of sounds of any string instruments.


C plus plus library functions for string operations?

You can use "string" class in C++ for string operations or you may use c style string functions as well. #include <string> String class in C++ provides all basic function to operate on strings. you may details descriptin at http://www.cplusplus.com/reference/string/string/


How is a sound generated on a string instrument?

By plucking the string you create waves which generate vibrations all sound and music are vibrations


How can one replace words in JavaScript's String Object?

The JavaScript's String Object has a function that allows someone to replace words that occur within the string. This works if the form letter with a default reference of username is available.