Skip to content
Advertisement

Tag: arrays

Why do Min & Max show up as 0 in my array?

Why do Min & Max show up as 0 in this array? I tried to figure it out for a while now but I couldn’t wrap my head around it. Here is the ‘min’. And the ‘max’ I am not sure what the issue is. ||SOLVED|| Changed min and max and also added maximum(x); minimum(x); in main while removing ^^

How to count the number of elements in one input

I hope you can help me with my task. I have tried to research different sites for this, but can’t find the specific one. Let us say that I’ve input 3, 2, 1, 5, 6 then the output should be 5. Another example is I have inputted 1, 2, 3, 4, 5, 6 then the output should be 6. It

Loop Object from a single Array

im sending a Json Array from Activity A to Activity B, and i want to populate that Json Array into Spinner in Activity B. but when i Log the json array from Activity A, the data becomes a single object “NVAKSINATOR” : [{“NVAKSINATOR”:”[{“NVAKSINATOR”:”20800″},{“NVAKSINATOR”:”0″},{“NVAKSINATOR”:”77350″},{“NVAKSINATOR”:”51750″},{“NVAKSINATOR”:”30000″},{“NVAKSINATOR”:”51500″},{“NVAKSINATOR”:”25750″},{“NVAKSINATOR”:”30900″}]”}] i want that number like 20800 , 0 , 77350 to be populated in spinner but i

How to split string of mulitdimensional array

i have string here String str1 = “{{1,2,3},{4,5,6},{7,8,9}}” and the result i expect is like this what method i use in java language? Thanks. i tried with split method then put each array into an arraylist variable “data”. result : and try to delete the data array that is empty and which only has a string value”,” result : and

What’s the difference between these 2 array definitions?

What us the difference between int[][] a = new int[2][3] and int a[][] = new int[][]{{11,12},{13,14,15}}? I decompiled the .class file and found in the first case, the JVM will use multianwearray to create the array, while in the second case, it will use anewarray. I think in the first case, JVM will create a continuous space. Am I right?

Big Decimal array not sorting 0 and 000.000

I was solving a java HackerRank problem in which I had to sort an array consisting decimal numbers using BigDecimal class in descending order. The solution works fine except for one case in which 0 and 000.000 comes. Now as they are equal, the problem tells us not keep them in the same order of their occurrence, but it is

Advertisement