mercredi 3 mars 2021

Can a kotlin app be tested using kotlin REPL?

I'm very new to Kotlin, so I'm reading a book that teaches how to use the kotlin REPL to explore ranges

1 in 1..3 returns true

(1..3).ToList() returns [1, 2, 3]

and so on...


let's say I'm programming the HelloPerson app, and I want it to display a message greeting the person, like println("Hello ${args[0]}!") and that code would be inside the main function. So I can't figure out if I can use the REPL tool to do something like what you do using the console with the compiled class, like "java HelloPerson Jay" to display the message.

can I use this tool to run the app I'm coding for passing arguments to the main function so I can test it?

Aucun commentaire:

Enregistrer un commentaire