+ 4
Can anyone please explain the Value types??
7 Respostas
+ 5
Thanks Ankusha Khotele, and you're welcome : )
+ 6
Hello, 😊
Can you specifying your question correctly!
Use the search bar!
https://www.sololearn.com/post/10362/?ref=app
Please, read our guidelines:
https://www.sololearn.com/discuss/1316935/?ref=app
An useful code for any new user here!;)
https://code.sololearn.com/WvG0MJq2dQ6y/
+ 5
Please add "java" to the "Relevant Tags" of the original post, it helps others to understand you sooner by indicating the language.
To answer the doubt, the addOneTo method in the lesson was designed to show you that value types are immutable, that means when the <num> is incremented in the method the changed value of <num> is only recognized in the addOneTo method itself, not where they were declared initially (main method for example). The original variable value is not changed, I hope my explanation was clear enough.
+ 3
I think you are asking about data types in programming languages?
If my guess is right than here's the answer
There are different types of data such as numbers , strings etc.
To declare variables we must specify the data type , variable is holding.
If its integer we write
int a = 10; (C language)
Hope its helps☺️☺️.
+ 3
Thank you Meet and Rahul. My doubt is why in Value Type example, mentioned in Value Type topic i.e. me to
Static void addOneTo(int num)
{ num = num+1;
}
doesnot make any change to variable value
+ 3
Thank You Ipang. I'll add the tags further Danijel.
+ 1
value type means a value is given and is't type is "char" than we want to put values line some ones name or some alfabate and when vlaue type is 'integer ' than we want to use number 1,2,3,3423,
and in condition of "flot value " we use decimals 6.7,0.6