How would you display each element of an array that is returned from another method in Java? -


for example, have main method method returnodds(original), returns integer array "odd"

how print elements of array in main method? loop?

a for loop work. if don't care format, though, simpler solution might use arrays.tostring, convert in form "[elem1, elem2, ..., elemn]".


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -