answersLogoWhite

0

What is the defualt value for String in java?

Updated: 8/20/2019
User Avatar

Wiki User

11y ago

Best Answer

The default value for objects is null; I believe this would apply to a String, too, since Strings are objects.

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the defualt value for String in java?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What are some example for string formatting in Java?

There are lots of examples of string formatting in Java. It can be difficult at times. Some of these examples are, but are not limited to; align, string, format, and JAVA.


Why using parseInt in java?

parseInt is a method in the Integer class in java and is used to parse string values into integer numbers. ex: int i = Integer.parseInt("10"); After the above line of code, the variable i will be assigned a value of 10 which is the numeric value of the string passed as argument to the parseInt method


How you convert int to string in jsp?

The same way you would in a regular java program. int i = 10; String s = i + ""; after the above line of code the variable s will have "10" as a string value...


Java null pointer exceptions?

A null pointer exception in java comes when you are trying to perform any action on an object that isnt initialized/has a value i.e., is a NULL Value Ex: private String s; //declare a string if(s.equals("test")){ //do something.. } You will get a null pointer in the if condition because you are checking a value that is null which is not allowed..


What does it mean to have a string split in java?

To have a string split in Java means that a string array, containing substrings (can be delimited by elements of a specified string or Unicode character array), is returned.


How do you get boolean value from string in java?

Here is some sample code to convert a string into a boolean: String word = "true"; boolean boo; if (word.equalsIgnoreCase("true")) boo=true; else boo=false;


In computer terms what does the phrase 'java string replace' mean?

When referring to computer terms, the phrase "java string replace" means that a string in the line of code that Java uses, is being replaced, or needs to be replaced.


How does the string trim work in Java?

The string trim works in Java by trimming white space from the beginning and end of a string. It cleans up the string and makes makes it neater for the users of the program.


What are the different between'a' and ''a in java string methods?

The difference between 'a' and "a" anywhere in Java is that 'a' is a primitive char type, while "a" is a String object.


Is String in java a class or object?

String is a pre-defined class in Java. For example: String s = new String("This is a string"); the variable s is now a String object since it was declared and initialized in the String class.


How do you create string array in java?

String[] myStringArray = { "abc","def","xyz" }; You can access elements of this array by using the [index] operation. Ex: myStringArray[0] will contain value "abc" and myStringArray[1] will contain value "def" and so on...


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.