Java (not to be confused with JavaScript) is a class-based, object-oriented, strongly typed, reflective language and run-time environment (JRE). Java programs are compiled to byte-code and run in a virtual machine (JVM) enabling a "write once, run anywhere" (WORA) methodology.

learn more… | top users | synonyms (2)

1
vote
0answers
9 views

Releasing references with server connection library

I work on a custom library (Co.line) to do HTTP requests in REST. I tried to think of reducing the memory usage by cancelling the thread background and destroying all references. It uses a ...
-3
votes
0answers
17 views

Find largest sublist by particular criteria [on hold]

I'm struggling with quite interesting assignment and looking for advise. The case is to find the largest sublist from the given set of pairs. First elements from these pairs should be in ascending ...
4
votes
2answers
47 views

Merge sorting a singly-linked list in Java - follow-up

In this iteration, I incorporated all but one points made by forsvarir in the previous iteration. Now my code looks like this: LinkedListNode.java: ...
2
votes
2answers
52 views

Java number formatting in accountant style

I have written a string number formatter. I would like to know if this can be improved and any suggestions with how it's done. The purpose of this function is to convert a double that has been ...
-3
votes
0answers
14 views

Split inner url [on hold]

I want to split the URL into parts. Can anyone help me as i am new to this concept of splitting. ...
7
votes
4answers
603 views

“Course manager” Java program

As of right now I'm a beginner with programming and Java and I've only had a few months of practice so far. This is a project I've been working on as practice. It's essentially a basic course manager ...
2
votes
1answer
40 views

Adding a specific list of numbers to an array

I need to add a range of numbers to a list based on specific conditions. The method recieves a String, and based on value of the String, specific list of values should be added to the list. Name ...
2
votes
1answer
26 views

Catching notifications using Accessibility Service Android app

I am currently working on an app in which one of the tasks is to catch the notifications of different applications (phone call, Facebook, Twitter, Whatsapp etc...). Now I will have some values pre-...
3
votes
2answers
91 views

If zero found in Matrix. make entire row & column zero

Problem is - If in an MxN matrix, a zero is encountered, the entire row and entire column should be set to zero. Example - 8 4 2 2 3 7 1 0 1 9 8 4 ...
2
votes
1answer
46 views

Merge sorting a singly-linked list in Java

I have this nifty merge sort implementation for sorting singly-linked lists. Its running time is \$\Theta(n \log n)\$, yet it uses only \$\Theta(\log n)\$ space (the stack). See what I have below. ...
0
votes
0answers
30 views

Re-Ordering the draw order for my entities in my Isometric game

Introduction I am making a 3D Isometric game. I have a Tower, filled with Block's in a 3D ...
4
votes
1answer
99 views

The Thirsty Crow

Problem Statement There are N pots. Every pot has some water in it. They may be partially filled. So there is a Overflow Number O associated with every pot which tell how many minimum stone pieces ...
1
vote
0answers
32 views

Telegram Rest API client design

I'm working on a "framework" for Telegram bots and right now everything "just works". I'm now in the process of rethinking about what I wrote and one of the things I dislike a lot is how I implemented ...
6
votes
5answers
1k views

Interview solutions to reverse a string and reverse a sentence

Recently in an interview I was asked to Write a method to reverse a string. I used StringBuilder but was asked not to use reverse method of builder but iterate ...
1
vote
0answers
21 views

Pagination from resultset for JTable

I am trying to create simple app, where I need a pagination for my JTable. I want have there buttons with number for all "pages" in my JTable. I have code here: Class Customer: ...
-1
votes
0answers
13 views

parsing a table with jsoup [on hold]

i'm trying to extract the e-mail adress and the phone number from a linkedin profile using jsoup. I have written a code but it doesn't work, the code should work on any linkedin profile. Any help or ...
-1
votes
0answers
21 views

Image input output in Java [on hold]

In this code I have taken an image as input and output the same image. As far I know if two images are same then their PSNR value will be inf. So I calculate their PSNR value using MATLAB but it shows ...
4
votes
2answers
88 views

Testing if array is heap

This method tests an array of integers satisfies to see if its a max binary heap. This means each node is greater than or equal to it's children each node has at most 2 children the leaf nodes are ...
0
votes
0answers
28 views

Check fragment for exclude show same fragment again

I use this code to check a fragment before showing it. What can you say about it? ...
0
votes
0answers
12 views

Simple cache to avoid database read [on hold]

My goal is to use as a Map as a simple cache in a threadsafe manner i to avoid reading from the database. I'm solely interested in the correctness of my code below to achieve the goal so please ...
0
votes
2answers
36 views

Exception handling in URL builder method

I have a method which is part of a request-handling class. It creates a URL, depending on the resource send request. This is a part of the REST service: ...
2
votes
1answer
47 views

Bare bones implementation of Java HashMap

I've done a minimal implementation of a HashMap. Invite comments. ...
0
votes
1answer
57 views

Stack implementation with exceptions [on hold]

I would like to know if this is a great stack implementation. I created my own exception. Was that a bad idea or unnecessary? Should I have just thrown a IndexOutOfBounds exception instead of my own. ...
-3
votes
0answers
14 views

ok here am I doing a code on how DequeMethods work to demonstrate what they do and I must admit I'm at a loss [on hold]

well here is my code and sorry to sound like a total amature and I'm attempting this because truly I am one such person so now I'm having trouble creating code for methods that will act as the deque ...
0
votes
0answers
13 views

Luck Numbers - Code [on hold]

A number is said to be a lucky number if it is a positive non-prime integer whose sum of the digits of its square is equal to the square of the sum of the digits. eg 22 is a lucky number as: S(484)=S(...
3
votes
2answers
66 views

Proper Stack Implementation

I want to know if this stack is implemented properly. Previously I was told a Linked List contains an inner class that represents a node and the outta class that represents the structure. Does that ...
0
votes
2answers
57 views

Using enum to reduce page object method

I had written following page object class which represents user profile page. The profile contains department, teams, email and login labels and corresponding values. Initially I wrote a page object ...
-3
votes
0answers
20 views

Android app - Endoscope wifi live video streamer [on hold]

Endoscope allows you to fast link two android devices and stream live video from camera one device to another. Video stream is over Wi-Fi. One device hosts live stream and another connect to it. ...
2
votes
0answers
35 views

Randomizer App as Decision Maker

I am a newbie and self taught in programming. This is my first attempt to make app. Appreciate any input or comment to make my code writting skill better. https://github.com/snufflesrea/Decision-...
2
votes
1answer
38 views

building a search functionality

I am trying to search account table by providing a search string. I am building a query based in different conditions and then adding the returned records in a list. The functionality is working ...
4
votes
0answers
54 views

File downloader using Java, multithreading and HTTP Range request

I'm making a file downloader using Java. The project is on GitHub; I have included the most relevant excerpts here. I separate the file into parts and download them using HTTP Range request, with ...
6
votes
2answers
104 views

Beginners project: calculating area

This was my second project as a beginner in Java programming. Please provide feedback/ tips on my program. ...
0
votes
0answers
18 views

Queue Implementation Java [on hold]

I have to implement a waiting room management system in an emergency ward of a hospital.This is done using queue.I am entering names of the patients..and an ID will be given to them randomly..lets say ...
0
votes
0answers
11 views

This class represents a single rainfall measurement from a dataset [closed]

if got 3 issues with this code; 1. return the month of the measurement as a name rather than an integer. 2. Split the string into an array of strings containing the individual values from one record ...
4
votes
1answer
47 views

My version of Conway's Game of Life in Java

I am currently only doing one generation. I'd like a review of my code. Game of Life: The universe of the Game of Life is an infinite two-dimensional orthogonal grid of square cells, each of ...
2
votes
1answer
64 views

Implementation of Queue using Linkedlist in Java

Can someone please review my code? Is it the correct implementation of a queue? If not, please give suggestions on how to implement it using a linked list. ...
3
votes
1answer
59 views

Basic Calculator in Java 8

I was reading this post and saw quite few improvements. So I tried to rewrite it using Java 8 features. Any improvements you can spot, please feel free to mention. ...
3
votes
7answers
206 views

Beginners Java calculator

I am a beginner in Java programming, and I created a calculator as my first Java project. Therefore, can you review my code and provide feedbacks/ tips? ...
2
votes
1answer
67 views

Concatenating two substrings to provide the largest possible palindromic string

The code extracts two substrings from different strings and concatinating them to provide the largest possible palindromic string. Objective: You have two strings, (a) and (b). Find a string, (c),...
2
votes
0answers
40 views

Java member method initialization pattern

To avoid the overridable method call in constructor dilemma this approache delegate the variables initialization and calls to overridable methods to a member method that return reference to the ...
2
votes
1answer
37 views

Efficiently calculating differences between file using diff file

I'm using SVNKit to get diff information between two revisions. I'm using the diff utility to generate a diff file, however I still need to parse it into numbers. I implemented a solution, but it is ...
9
votes
2answers
177 views

Displaying all substrings of some given string

I solved exercise 8 from Core Java for Impatient, chapter 1. This exercise is to implement a displayAllCombinations method to display all substrings of the given ...
2
votes
1answer
42 views

Data structure limited by range

For a utility class, I've created a particular implementation of a list where the list's items can be limited to a specific range, using the google guava Range utility. Items in the list must ...
4
votes
1answer
40 views

Stampcalculator - Given a set of stamps, what combinations are there to reach a certain amount?

Background My mother has a hobby of buying and reselling books via online trading sites. After a price is agreed on, the books have to be put into an envelope for mailing. On this envelope, stamps ...
0
votes
0answers
26 views

Should my Java method close the input stream? [closed]

I have a Java class responsible for validating documents, it looks like this: ...
0
votes
1answer
52 views

Take two sets of randomly-sorted scores and find their common improvement percentage [closed]

I was studying for an upcoming phone interview, and Googling programming terms which I needed to strengthen myself in. Well after I Googled "Dependency Injection", a banner appeared asking if I ...
0
votes
0answers
22 views

Check the battery's charge level and emit an alert on low/high value

The following script check constantly the battery's charge level of the user's laptop via the acpi command. When such level reach a low/high value, the script will ...
5
votes
2answers
42 views

Filtering conversation by filter type and value

I have been assigned to developed a feature that filters a conversation. For example, I want to filter the conversation by user id then export it to something either JSON or text file. In this case, I ...
0
votes
0answers
19 views

Servlet to generate HTML printable form

I'm using a java servlet to generate HTML code to produce a printable form. I want the form to look like the paper version being used now (or as close as possible) to reduce confusion during the ...
2
votes
1answer
49 views

Optimizing Java HTML parser

I wrote a program that goes through a webpage and returns matches of regex. I used it on my letterboxd.com account to go through all of my movies (over 900 entries) and then find genres field for each ...