Skip to content
Advertisement

Tag: arrays

The method countTrue(boolean[]) in the type GUI is not applicable for the arguments (boolean, boolean, boolean, boolean, boolean)

this is the error : “The method countTrue(boolean[]) in the type GUI is not applicable for the arguments (boolean, boolean, boolean, boolean, boolean)” , the error is in the last line , but i dont get why. Answer New array should be declared as below: int x = GUI.countTrue(new boolean[]{true, false, false, true, false}); OR you can use varargs and

How to merge two sorted array?

Question is ==> You are given two integer arrays nums1 and nums2, sorted in non-decreasing order, and two integers m and n, representing the number of elements in nums1 and nums2 respectively. Merge nums1 and nums2 into a single array sorted in non-decreasing order. The final sorted array should not be returned by the function, but instead be stored inside

data type and calculate average in java

I am working on a java code that calculates the average of grades in an array for N of students and it is working fine when I enter grades like {3,4,3} but when I use numbers with decimals like {3.7,2.5,3.2} it starts giving me errors and I want to make a class of data type Students for example. Any help

How do i make use of groupingby in java

I have a movie list from a web service that i need to group using genres attribute from the data. My question is very similar to this groupby ngFor angular2 but in java instead. movie list from the web service looks like this here is what i’m trying to achieve but i cant seems to get it right i’ve tried

2d double array to image

I’m currently working on a simulation with continuous agents, which leave a pheromone trail on a 2d double array. The pheromone trails need to be on a 2d array because of a diffusion with a mean filter that needs to be performed. Ultimately, I need to visualise the agents and the pheromone trails, by transforming the double array directly into

Advertisement