I was trying to run a simple program in scala involving implicit class in scala. The expected output of the program is "CZF" i.e. incrementing each character by 1. But, when i am executing it on Eclipse IDE, its not returning any result nor the error.
object ObjectImplitclass extends App{
implicit class StringIncImplicitClass(s: String){
def increment = s.map(c => (c+1).toChar)
val result = "BYE".increment
print(result)
}
}
When i tried the following chunk of code on terminal:
implicit class StringIncImplicitClass(s: String){
def increment = s.map(c => (c+1).toChar)
val result = "BYE".increment
It returned me "CZF". I am new to the scala syntax, can anyone help me as to why i am not able to see the result on IDE.