java's questions - English 1answer

8.696 java questions.

I created a custom responseModel to have a standard json responseModel for some of my different RestController. Superclass TransactionResponseModel: ...

This is what I wrote to validate JSON to the given schema. ...

I have a program that uses ArrayLists to store a pyramid that has been read by a txt file and calculates the minimum sum value of travelling from the top of the pyramid to the bottom. My code's main ...

I have this class/service, which I need to maintain. Its purpose is to manage a temporary directory so that all content can be deleted on next restart files are not left behind when you're done with ...

I am developing JSafebox, a portable safebox project written in Java. A first review have been completed here. The goal is to provide a secured environment where the user can browse encrypted files ...

I was looking for suggestions on how to improve the general flow of this code, as well as minimizing if / switch conditionals. ...

From my understanding, we use threads In java when we need multiple event to occur at the same time, or in other words, the machine will run many threads concurrently withing a single program. Still,...

This class, UnorderedLinkedList, implements an Unordered list in Java. Since it is ...

I am very new to Java, I have written a simple code: ...

My question is similar to basket ball game.The ball should come out from basket.but when I try implementing.The ball is going from beside of the basket. Here is the code for Circle. package com....

I'm trying to implement A_Star algorithm with Java, I've written the code by a lot guids, but there is still some problem - My code doens't find the path correctly. Same data, Vertex, Edges, Graph i ...

Let's say I have a List contains numbers: 1,2,3,4,5,6,7,8,9 and I would like to split this to two lists: odd numbers even numbers So I can do this two ways: Solution 1: Create two methods:<...

I'm creating a mini game for Android inspired by space invaders and Moon Patrol. I have completed the important part except for collision detection. Before I do collision detection I want to clean the ...

I am modeling a situation where people (smurfes in this case) want to take a Bus to get from A to B. They have a schedule of points where to go. As long as their schedule is not finished, this is ...

I've written the code to perform some action every 5 minutes, regardless if the application is currently on the foreground or not. I'd like to get a feedback about correctness - have I chosen the ...

I wrote the code to the below question. I'm able to return the pairs but an additional array is being added to the output which makes the test cases fail. Please review and let me know what can I do ...

I'm trying to compress this code and make it functional but also meet my projects guidleines which is to output "Please enter the total of your bill", "How much would you like to tip", "The tax is:", "...

Let's say there is an application which uses the forms package and <whatever>Form.java for validation purposes in the ...

Recently I have attended an Interview with a firm. They gave me a task to complete. I have done it and tested it as well. But they rejected my code. Is the given code properly written? Is my coding ...

I'm trying to increase the performance of my N Queens Puzzle solution. I'd find some threads on SO already but they don't appear to help me to increase performance. My best solution, however, is a ...

Given an integer X within the range of 0 to 9, and given two positive integers as upper and lower bounds respectively, find the number of times X occurs as a digit in an integer within the ...

Given an array of n integers(duplicates allowed). Print “Yes” if it is a set of contiguous integers else print “No”. INPUT: The first line consists of an integer T i.e. the number of test ...

I've written a simple Java class to encrypt and decrypt files using AES. The code works and I'm able to encrypt and decrypt files. However, I understand this is an easy way of implementing AES and ...

I'm pretty new to Java and I've been trying to use top-down design and make my code very readable, so I would appreciate any comments as to the clarity and efficiency of this program. Looking for ...

I want to display a text of variable length in a cardView. To make the text fit, I split the text after every 500 Chars and add the substring to another ...

As a hobby project I implemented Game of Life in Java using Swing. I don't have much experience with Java using Swing and would like to get feedback on the code. One thing in particular that I would ...

One of my first projects. I present to you - Android Flashlight app! ...

My question about servlets . I have a small task. On index page you should choose color of coffee and then it appears brand according what color you have chosen .In java class i wrote code where if ...

I was reading the MODELS - VIEWS - CONTROLLERS paper by Trygve Reenskaug from December 1979 and wanted to try an implementation with Java Swing from my understandings. Notes I have taken are as ...

I am looking for some feedback regarding my Java Tic-Tac-Toe implementation. Player.java ...

I want to check for a condition in a guarded wait() loop with a user-specified total timeout, similar to how ...

So I created a class named OrederedList which does not support duplicates. To check if an element already exists or not I tried ...

I have implemented a simulation which is called "Langton's Ant" with Java. Here is a short summary of basic rules: A ant is placed in a 2D matrix and looks to north, west, east or south. First, all ...

I have written my own solution to the Reader-Writers problems using semaphores based on the psuedocode from Wikipedia. I would like to gauge the correctness and quality of the code. ...

The code of my Guice Module looks like this: ...

I am trying to find a a nice succinct way to iterate over the following HashMap values and stop once a condition has been met (using a Stream), returning the subset of values that have been iterated ...

I have a 20x20 field that contains Square objects. Each Square contains a Rectangle that is ...

An array is said to be hollow if it contains 3 or more zeros in the middle that are preceded and followed by the same number of non-zero elements. Write a function named ...

It only returns the 0 An array is said to be hollow if it contains 3 or more zeros in the middle that are preceded and followed by the same numberof non-zero elements. Write a function named isHollow ...

I am making an app which will display the images of celebrities and 4 names out of which one is correct , I have added a button "change" to change the celebrity in the image, But on pressing that ...

I have implemented a little Flappy Bird clone with swing. I'm pretty new to Java, especially in graphic programming, so I'm really glad if someone an give me a feedback to my Code and maybe to ...

I am a self-taught programmer and I just started learning Java and wrote a simple program. If anyone more experienced than myself can go over my code and give me some pointers I would really ...

I'm new to Android programming. I am going to make lots of HTTP requests: 500, 1k, 2k, 10k. I have tried to create a singleton class for OkHttp. I wrote this: ...

I know there is a simpler way of doing this, but I just really can't think of it right now. Can you please help me out? ...

I have tried to create the async task using the RxJAVA2. The code is working fine. WHat enhancement can I do in this code? ...

I faced some issues in a project with spring and hibernate where the stream given to Blob is not closed. ...

I am working on the "Bovine Shuffle" problem from the December 2017 USA Computing Olympiad, and have got it to work for every test case beside two. When I run these two cases on my own computer, they ...

This question is a follow-up question of this question. These features are added to the new class - Generic class User is capable of setting the size ...

I'm working on an Spring Integration application that transforms a XML (converted by Jaxb) into a custom Object by checking various information given in the XML. The problem is that I can't trust ...

Description The ActivityLifecycleHelper uses wrap(Context)to create the class and save a global ...

Related tags

Hot questions

Language

Popular Tags