Java (not to be confused with JavaScript or JScript) is a general-purpose object-oriented programming language designed to be used in conjunction with the Java Virtual Machine (JVM). "Java platform" is the name for a computing system that has installed tools for developing and running Java programs. ...

learn more…| top users | synonyms (8)|java jobs

1
vote
1answer
30 views

when and why would you prefer to define your own LinkedList class from scratch rather than useing java.util.LinkedList

if java has provided the LinkedList class that would make your life a lot easier ... what would be a good reason for a developer not to use the provided LinkedLIst and build own LinkedList from ...
-4
votes
0answers
18 views

Sort file by using Insertion Sort [on hold]

I have President.txt like that:Kennedy, John Fitzgerald05 29 1917Johnson, Lyndon Baines08 27 1908Nixon, Richard Milhouse 01 09 1913Ford, Gerald Rudolph07 14 1913Carter, Jimmy10 01 1924...
1
vote
0answers
30 views

Is it possible to use recursion on a Stack to obtain the same functionality of a Dictionary

I'm working on a programming assignment which requires measuring the nested depth of HTML tags. This is an easy task for a dictionary however we are meant to be using Stacks and ArrayLists for ...
-3
votes
0answers
17 views

Avoid disabling a service

I create the service for my application but the user can turn off this by going to the settings.What should I do to prevent the user from doing so?
0
votes
1answer
16 views

Unit tests: Bitmap always equals null while trying to load it from test resources using BitmapFactory

I need to load Bitmap to test class methods on it. In order to do that, I created LoadBitmapFromTestResources method:@RunWith(PowerMockRunner.class)@PrepareForTest( {ByteBitmapConverters.class, ...
0
votes
1answer
21 views

IF doesn't work well on ListView item

ListView is generated from JSON with boolean getExpired.if getExpired() is TRUE, than it should be changed textColor.but it set on list position even if==FALSEWhy 1st position is changed, if ...
0
votes
0answers
33 views

txt file to array (NO LISTS)

I am trying to read in a file with 81 integers and populate an array with those 81 integers so I check the numbers for validity.public static int[][] ReadIn () {Scanner input=new Scanner(...
0
votes
0answers
6 views

Find the observation with the given ID, hapi Fhir

Bundle response=client.search().forResource("Observation").where(....).returnBundle(Bundle.class).execute();Searched a ...
0
votes
1answer
7 views

CombinedConfiguration Order Priority

When adding configurations to an CombinedConfiguration (from Apache Commons Configuration 2), does the configuration added first or added last have the highest priority?For example, say I have a ...
0
votes
0answers
26 views

use collect() method to report same day collection data

Question, Id like to use the java collect() method to search a database collection for collections on the same-day. Example, this won't work below because the time is factored in I believe, so is ...
-4
votes
1answer
27 views

How the same code works in all environments like dev or qa or prod

We have developed the rest endpoint like dev or qa but how do we make our code recognize the environment?
0
votes
1answer
26 views

public void OnBackPressed() vs public override void OnBackPressed() vs protected override void OnBackPressed()

ImageI just want to see whats differences between these three types?In all my situations i'm using public override void OnBackPressed()My first question is what the difference between above?...
1
vote
0answers
19 views

AssertionError trying to check dashboard URL is opened after login

I am new in selenium, I try to login and check if dashboard URL is opened, but java.lang.AssertionError appears every-time. Please help me to understand what am I doing wrong. I try to compare if ...
0
votes
1answer
24 views

Correct spacing between expressions after converting from infix to postfix expression

Currently I have a program that converts infix expressions to postfix. However, I want my postfix output to be like so:Infix expression: (11+11)*(11+11)Current postfix expression: 11 11+ 11 11+*...
-3
votes
3answers
25 views

Cannot resolve method 'openFileInput(java.lang.String)'

I have a broadcat receiver class and I want to use my method "ReadInternalData" to read the internal data in my app, but I can't manage to solve the problem of Cannot resolve method 'openFileInput(...
0
votes
0answers
5 views

Trouble accepting invitations using Google real time multiplayer

I am using the code that google has provided to get the multiplayer real time service to work, but it keeps saying this error when I try to accept the invite request. It says this code is the issue....
-2
votes
1answer
26 views

What causes Exception in thread “main” java.lang.ArrayIndexOutOfBoundsException: 1? How i fix it? [duplicate]

I compare two number's digits.When digit's locations and values are correct,numofPositives is increased.When digit's location is false, value is true,numOfNegatives are increased.Here is my code that ...
2
votes
1answer
19 views

2 JSP use same class(Old class)

I try to write 2 jsp that call the same class, but I can't do that. It look like I have create a new object for each jsp.<!--First jsp--><body><%int i=9;TestClass ...
1
vote
2answers
17 views

Cassandra start error with ThreadPriorityPolicy=42

When I am trying to start Cassandra it shows me error like this I already did changes in the conf file also in env.sh, the file also. No options of similar type error is working for this.intx ...
1
vote
3answers
39 views

Problems with try/catch java

I am having trouble using this try/catch statement. I am trying to use it to throw an error message that says, "Please enter an integer!" if the user enters a letter. The first one I used worked, but ...
-3
votes
0answers
20 views

Cannot be converted to Measurement in Java?

So i've got a method which reads in data from a CSV file and then stores them as String objects in a ArrayList, then im carrying out various different other methods on the data. But i keep getting an ...
0
votes
0answers
11 views

Directionfinder calulcate waypoints

i try to build app from it show a route calculate time travel and distance. of moment only it calculate distance and time from two point A & B, i need add waypoints, and that it calculate distance ...
0
votes
0answers
10 views

Java access websocket Api

i want to work on json wss api . i need some guide to where to get started in netbeans. This is the API doc: https://github.com/etherdelta/etherdelta.github.io/blob/master/docs/API.mdURL that works ...
0
votes
2answers
38 views

What is Happening in This Java Code?

If you don't mind, could you please explain something to me. i understand what this code does for the most part, and how it capitalizes the very first character in the String. What i don't understand ...
0
votes
1answer
41 views

Calculating time on the path of the sun

As a beginner in java, I am trying some simple case. As from this SO post and 2nd link to the pdf file given there, I have developed this code:import java.time.LocalTime;import java.util.Calendar;...
0
votes
0answers
23 views

What makes arraycopy() method of the System class faster than any user defined copy methods?

int[4] a={1,2,3,4,5};//any integer array of length 5int[4] b={9,8,7,6,5};System.arraycopy(a, 0, b, 0, 5);for (int i : b) {System.out.println(b[i]);}why is the above mentioned method ...
0
votes
0answers
13 views

Spring boot RestTemplate and status 400 bad request error after some requests

Has anyone had a problem using RestTemplate and after execute many request? around 2000 request. I'm try to consume a api from my Spring boot app, but after some time I get the 400 bad request error...
-2
votes
1answer
39 views

Why I get a “D” (double, don't think bad) after the first number of my ArrayList?

I recently made this simple software in Java that is supposed to scan some integers, search for duplicates, remove them from the ArrayList and show the new ArrayList with no duplicate values....
0
votes
1answer
22 views

JavaFX - Call UI updating methods with pause inbetween

I am working on a JavaFx school project at the moment where I try to move an imageView across a GridPane. The movement should be visualized/updated on the UI sequentially. I tried AnimationTimers ...
1
vote
3answers
44 views

How can I pass a value of type enum in a constructor?

I am not too familiar with enum type and I must create a Sport competition class which extends from the class event. It takes in 2 new parameters, one of them being the season of type enum. Not sure ...
0
votes
0answers
17 views

How to create a UriMatcher that can match mildy complex patterns?

I'm trying to make the UriMatcher match on something with two id's in it:content://com.example.myapp/letters/lookup/87030b770a0f47b78d65b4254bdc0159/eeccdd496f414dd4a7875739f42df82fI did the ...
0
votes
1answer
20 views

When button clicked, replace entire window content with an image

SOLVEDSo I have an issue where when I click the button, I want an image to replace the entire content of the window. But it's only replacing, what I believe to be, a part of a panel. Should I not ...
-5
votes
0answers
33 views

regex to to replace this pattern in java “</abc><abc>” and replace it by , [on hold]

Regex to replace "</abc><abc>" pattern in xml string and replace it by "," in java not abc should be same in consecutive tag elements.
-1
votes
2answers
25 views

How to make a mix constant string that has ascii text as well as ascii hex codes in it?

I want to define a constant string as following:"Hello World$1F"Where the '$1F' is the ASCII hex code.Your help is highly appreciated.
-1
votes
0answers
63 views

“Is protected in Java more like private or public?” [on hold]

I had an interview recently and this awkwardly worded access modifier question was asked. I answered with public because I had the "Access Modifier" table of the Java docs in mind (https://docs.oracle....
-1
votes
1answer
29 views

Don't understand the flow(type of request-response) of website to server

First of all, I've performed enough research on the Internet and didn't got the solution. That's why I'm asking this here.So currently I've developed a demo REST API for a website in Java, which has ...
0
votes
0answers
39 views

Sort array on basis of Bit count in ascending order

Please tell me what changes shall i make to sort the array in ascending order, on count of bitsConsider an array of n decimal integers named elements. We want to rearrange elements according to the ...
0
votes
0answers
9 views

Cannot index to elasticsearch from a web application

I have a web application running on tomcat that reads the log file and index them to elasticsearch.I use elasticsearch-6.1.1.I have add the elasticsearch-6.1.2 jar.But when i try to index to ...
0
votes
0answers
20 views

How to check a number in a string contains a date and exponential numbers while parsing excel file in java

I am parsing an excel file which contains many dates like 13-4-2021 and some numbers in this 3,7%,2,65% format.So i am parsing that excel file and i am getting the data in a string to write them in a ...
-2
votes
0answers
20 views

How to send file contents from Client to Server and manipulate the file at Server end with Java Socket programming?

I want to send a file content from client to server and manipulate the contents at server end and display it.e.g: Input:These are from filesOutput: These, are, from, fileswhere the input part ...
-4
votes
0answers
48 views

Reading a Java file into Java

I have a programming assignment for a Java programming class. I have to read in a java file, scan it, find all the “{“ “[“ “(“ and “/*” and make sure they have matching “}” “]” “)” and “*/” and if ...
1
vote
1answer
24 views

JAXP parse error on valid XML

I am trying to run some XPath Queries on XML in Java and apparently the recommended way to do so is to construct a document first.Here is the standard JAXP code sample that I was using:import org....
0
votes
1answer
28 views

JSON string not parsing header part of the string

Json string :{"event": {"event_name": "Customer Phone Number","operation_type": "Add","transaction_identifier": "1234567890","...
-1
votes
0answers
25 views

Create game field with 2d array in java

I'm currently working on a schoolproject in java where I have to code a game like Snake. First step for me is to create the game field with a 2d array and swing by drawing rectangles. To create the ...
-1
votes
1answer
24 views

Writing a word in a rhombus/diamond shape in java

I have to write a programm that asks a word and then prints it in a rhombus/diamond shape, like this:Word: HelloHHeHelHellHelloellollolooI tried something but I really could use ...
-2
votes
0answers
32 views

I can not run my app on my physical mobile but I can in the emulator

the emulator with the API 26 the app runs perfect, my physical phone has the version 6.0.1 Android Marshmallow and the problem I saw in the log is that this when using a library with movement in the ...
-3
votes
1answer
24 views

Trying to get an input that is only an int and between 1-3

I am making a TicTacToe game clone and need to get input about where the player want to place their selection.Here is the code:
0
votes
0answers
19 views

Controlsfx Notifications don't work in compiled jar

I'm working on some app with GUI using javafx and have one trouble.Notifications from controlsfx library (org.controlsfx.control.Notifications) work well when I'm running Main class from ItelliJ IDEA,...
-2
votes
0answers
30 views

Calling a 'method' in java from a different class

I have a problem with my program from connecting it together I've connected them but the JOptionPane only execute but the codes are not updating to my program, the codes for update(); is running in my ...
0
votes
1answer
34 views

“No such file or directory” while creating new file [duplicate]

This is how I'm trying to do it:public void SaveImageToMemory(Bitmap bitmap, String fileName){File outFile=new File(Environment.getExternalStorageDirectory().getAbsolutePath() + "/...

153050per page
angop.ao, elkhabar.com, noa.al, afghanpaper.com, bbc.com, time.com, cdc.gov, nih.gov, xnxx.com, github.com,