+ 2
Hey there!! Please write a code alternative to the code in the description↓↓ P.S. You can modify my code! Conditions below↓
~your code should be simpler and take less lines than mine ~it should have the same purpose! #Array is Palindrome or not# https://code.sololearn.com/cF4KOryUe1ji/?ref=app
5 ответов
+ 2
Hello,
The number of lines is very rarely a good measure of code quality. Technically you can write a java program in a single line but it would ruin the readability.
You should rather think about different levels of abstraction.
For example, an array of characters is conceptually the same as a String, and there are builtin methods to deal with strings easily.
https://code.sololearn.com/cW5p6KV5W6NW/?ref=app
+ 2
Yes, you should use the Scanner class for input.
You can use various methods like nextInt or nextLine to fetch as many values as needed, but if you have to enter more values on SoloLearn you usually need to put them in multiple lines in the same input box that pops up. There is no interactivity here.
+ 2
Tibor Santa yep! Thanx
+ 1
user friendly is input just one word as string
0
Tibor Santa can you please tell me a better and faster way to input in Java in SoloLearn?? Since I have been used to to the user-friendly interface BlueJ till now...that's what was being taught in my school!! And apart from it now I'm trying to this new interface, SoloLearn!!
Want to know to input almost everything, arrays, string, as far as you can say!! Most probably without scanner class / with scanner class , as your choice !(I only know about input through Scanner class😅)!