This is really a nice introductory video for val/var in Scala, but I think it would be good to first talk about expressions in Scala and then move on to a little bit complex example like the one mentioned on time 11:51. As it is bit confusing to read this statement when someone is just starting on Scala
@seanmceachern61514 жыл бұрын
Thank you! I couldn't figure out how to get into scala interpreter! I was just missing the scala console command. whew
@murifedontrun33636 жыл бұрын
The below code works: val x = { val x: Int = 100 ; val y : Int = 200; x + y} My question in regards to the above, is if we have already defined x with val as 100, then why in the result the new value of x i.e 300 is successfully getting stored? Why not throwing an error?
@Sanjusamson_8283 Жыл бұрын
As again we assigning the value in x (val x;int =300), it is taking as new value. Just try this (val x : int = 50) in the x variable 50 values is present .then x = 60 u can not change .hence we have used val. Just do same process with var . The x value will be changed
@vishakha19026 жыл бұрын
I have a query : val means immutable variable. Then in video you assigned val x 2 different values. And scala didn't throw any error. Why?
@imdebasispanda6 жыл бұрын
because when you do x * 2 you are assigning the result to a new variable(here its res3) not itself to x.
@tipandtrick57007 жыл бұрын
I'm open Android studio and open an existing android studio project but some errors this game 8 ball pool apk
@techzoo13 жыл бұрын
Thanks for creating an understandable tutorial about Scala. I’m sorry but the official Scala course on Coursera is a piece of crap in comparison.
@nallamillibalaveeraraghava96636 жыл бұрын
Just like swift language for ios
@rafiulhassan40277 жыл бұрын
putting val before any variable makes the variable's value unchangeable ,right? but here in the example of 1st multi statement/expression , once the result initialized in x variable < x: Int = 500 > and later on the 2nd example value of x changed < x: Int =1100 > how?
@pallavisingh71434 жыл бұрын
I also have this doubt.. Can anybody explain??
@bubblesgrappling7364 жыл бұрын
Am i the only one that this does absolutely not work for??
@tipandtrick57007 жыл бұрын
hello can you explain how to open 8 ball pool game and how to level change and how to coins change and how to change cash full detail give me please and how is some errors and problems so example and video give me notification OK