Skip to main content

All Questions

Tagged with
0 votes
2 answers
127 views

Can not create Function array in Java 8

I have a class called SFunction which extends from Function in JDK 8 @FunctionalInterface public interface SFunction<T, R> extends Function<T, R>, Serializable { } Now I have several ...
flyingfox's user avatar
  • 13.5k
0 votes
0 answers
54 views

Java Market Linked List [closed]

ItemTypesLists.java:79: error: incompatible types: Market cannot be converted to Zip return ZipList.get(index); ^ ItemTypesLists.java:83: error: incompatible types: ...
Chi Lee's user avatar
-4 votes
0 answers
54 views

how to write this row mapper in better way [closed]

'm working on a Spring Batch application and have implemented a custom Partitioner to divide processing across multiple threads. I'm having trouble writing a JUnit 4 test for my partition method. I've ...
abhijat mishra's user avatar
-1 votes
0 answers
27 views

How do I code a maze in a java class then display it in a jframe form? [duplicate]

I would like to code a maze on Java Netbeans. I am trying to display a 2d array as a maze on a canvas but I have no idea where to start. Do I code the maze in a java class then call it from the jframe?...
LonelyBoi404's user avatar
0 votes
0 answers
76 views

Using arrays from different classes in java

I am making a TicTacToe game. The idea is I print a 3x3 grid with numbers from 1-9 and when a player selects a number it changes that element in the grid array with a character like * or o I'm facing ...
Coen Molyneaux's user avatar
-1 votes
1 answer
41 views

Array Index Out Of Bound Error for Finding an element in an infinite array by Kunal Kushwaha video

My Code public class InfiniteElement{ public static void main(String[] args) { int[] arr = {1, 2, 4, 6, 8, 9, 10 , 13, 16, 19, 20 ,23, 27, 40, 42, 44}; int target = 44; ...
UDAYA KRISHNAN.M's user avatar
0 votes
1 answer
60 views

Leetcode - Find the student that will replace the chalk

I tried the problem Find the Student that Will Replace the Chalk on LeetCode. There are n students in a class numbered from 0 to n - 1. The teacher will give each student a problem starting with the ...
Aprikose's user avatar
-1 votes
5 answers
126 views

How do I sort 13 random playing cards in order (sequence) in java?

I want to order 13 playing cards with order clubs, diamonds, hearts and spades, sequence 2,3,4,5,6,7,8,9,10,J,Q,K,A. For example 4C means "4 Club". I tried using the code below to order them ...
Dedetok's user avatar
  • 49
0 votes
0 answers
53 views

Non nested loop to find mode in Java

I got an assignment that my professor has given me the code but I have to fill the answers in the assigned line to complete the code I got with the fixed array in my problem but when I rearrange ...
doeeyes's user avatar
0 votes
2 answers
140 views

To modify the array so that all zeros are moved to the end while maintaining the order of non-zero elements [closed]

Given an integer array nums, move all 0's to the end of it while maintaining the relative order of the non-zero elements. Note that you must do this in-place without making a copy of the array. ...
Amar kumar Nayak's user avatar
0 votes
2 answers
75 views

unable to fill an array with numbers from input in java

I'm trying to set an array with desired length of numbers. It has to get the numbers from user but it throws an exception error after getting the first one. Can anyone help me to fix this please? ...
Nanika's user avatar
  • 21
-3 votes
0 answers
95 views

Returning a string vs returning an array in java [duplicate]

Consider below two code snippets showing java functions Snip 1: public String greet() { return "hello"; } Snip 2: public String[] greetings() { return new String[]{"hello", ...
Neha's user avatar
  • 1
0 votes
1 answer
82 views

How can I find the median of two sorted arrays in O(log(m+n)) complexity

I copy the length of two initial arrays and then merge them into a third array and the length of the third array is equal to the length of initial two arrays added together. Then I try to find the ...
Fazeel Ayaz's user avatar
0 votes
1 answer
64 views

Parsing a raw bytes through a string goes wrong in Java

I have problem with JTextArea, I just want to edit raw bytes (presented to String) from JTextArea, but some symbols have '?' character. Firstly just for test, I wrote console program for test on ...
BHms game Java's user avatar
2 votes
2 answers
125 views

How do I make an array threadsafe in Java?

I am pretty new to multithreading and want to understand it better. I want to now how to make an array threadsafe in Java? Meaning I have several threads accessing and changing the data in the array ...
KaMuench's user avatar

15 30 50 per page
1
2 3 4 5
3496