answersLogoWhite

0


Best Answer

Yes. Any special character inside the String is considered as part of the string variable and would not be treated as a special character.

Ex:

String str = "ABC_$4";

is a valid string declaration

User Avatar

Wiki User

15y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Is special symbols are valid as a string in java?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is number format exception in java?

That may happen when Java tries to parse a String, to convert it into a number. In this case, if the String doesn't contain a valid number - or perhaps if it contains additional symbols not appropriate for a number - you may get this error.


How can you convert byte to string in java?

To convert byte to String in java use the String(bytes, UTF-8); //example for one encoding type. You must know the special encoding that contains a variety of characters.


What is special about the lang and string packages for the language Java?

The string can never be modified, they are immutabile. If you think a string is modified, it is actually a new creation. It's basically a conversion of other objects.


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.


What is the constant string length method?

To get the length of the string we use length property. The length property returns the length of a string (number of characters we use).If the string is empty, length of the string will be 0. Syntax: string.length Hope this helps.


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.


Is there is any function or class in Java to check inputed string is valid char sequence and no numbers or any special char are there?

You should probably use regular expressions. For example, the following will check that the String s has only English (Latin) characters in it:boolean hasOnlyLatin = s.matches("^[a-zA-Z]*$");Learning to use regular expressions is scary at first, but worthwhile. See the related links for some information about regular expressions in Java.


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.


How do you convert an integer to a string?

That really depends on the programming language. In Java, it is sufficient to concatenate it with a String: int myNumber = 5; result = "" + myNumber; Other languages may require a special function, or method, to convert from integer to string.


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 unsigned int var valid in java?

No. Java uses no unsigned numbers.