In the previous article, I have explained about assigning different types of literals to the boolean data type variable.
In this article, I am going to explain about assigning different types of literals to the String non-primitive data type variable.
Java for Testers – Assigning different types of literals to the String non-primitive data type variable
String non-primitive data type variable only allows you to assign the String literal values (i.e. the sequence of characters in between double quotes).
But on trying to assign the literals other than String type, Java will give you a compiler error.
The below are the screenshots of the compiler errors displayed on assigning the literals other than String type:
Here conclude this article on assigning the different types of Literals to the String data type variable in Java.
In the next article, I will explain the remaining things about data types.
- > To learn more about Java, continue to the next post (Click on Next Post link below)
- > Check complete Java Tutorial Contents here (Click here)
Please leave your questions/comments/feedback below:
Happy Learning 🙂
Arun Motoori (www.QAFox.com)
On a mission to help the Testing Community in all possible ways.