24 Answers
New AnswerName Sololearn terminal is online terminal so everytime you can't take user input. If you have multiple input then you have to take all input once. In this case of your code you can take input like this in seperate line. 2 //total number of elements in array 123 //1st value of 1st array AJ //1st value of 2nd array 567 //2nd value of 1st array Name //2nd value of 2nd array. If you take it in one line then it would be considered as single input
Everything is fine Give input like this 2 2 37 29 Name Pankaj This is an example of your input
Name You should always write comment in your code for better understanding. That's the reason we have single and multiple line comment in mostly every language.
ok now it's clear 2 - - length 3 - - arr1[0] aj - - arr2[0] ........ Thanks And one more question... In python we wrote x = input("Name: ") Can I do it in Java too?
Ok got it... and in python we use GUI(Graphical User Interface) , is there anything similar to GUI in Java?
Everything is correct! The problem is in the Sololearn IDE which takes all the inputs at once. example: - input: 2 1 One 2 two Output: [ 1, 2 ] [ one, two ]
Atul if I enter like you the first array contains 2 integer... ok... And though the second array contains String but 37 replaces Pankaj.
Vicky will the same error occur in other IDEs? Do I need to enter in this formation in other IDEs? Or it's for sololearn only?
Atul, 2 - - length 4 6 - - two integers for array 1 Atul Atul - - two strings for array 2 It says error... If I enter like you 2 2 37 29 Name Pankaj Where is Pankaj in array 2?
SoloLearn Inc.
4 Embarcadero Center, Suite 1455Send us a message