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)

3
votes
0answers
13 views

Stepping Number Solution Optimization

I have the following problem: The stepping number: A number is called a stepping number if every adjacent digits, separated by commas, differ by 1. A stepping number can't be a 1-digit ...
2
votes
0answers
42 views

Deadlock watchdog in a server to defend against poorly written extensions

In the Red5 server we have no control over what implementers do with their applications and as such we have attempted to implement code that would prevent them from causing bad things to happen. ...
11
votes
6answers
392 views

Beginning Blackjack program

I am fairly new to this, so please tell me whether this is a good way to write code or if I'm missing anything. ...
3
votes
0answers
22 views

Parallel MSD radix sort in Java

I have this parallel implementation of MSD radix sort, which processes the entries by one particular byte. At each byte index, it has three phases: Count the bucket sizes. Insert each entry to its ...
1
vote
0answers
13 views

MSD radix sort in Java for parallel arrays - follow-up 2

The previous and second iteration at: MSD radix sort in Java for parallel arrays - follow-up Changes: arrays[j][i] != arrays[j + 1][i] to ...
4
votes
1answer
43 views

MSD radix sort in Java for parallel arrays - follow-up

The previous and initial iteration at MSD radix sort in Java for parallel arrays. Changes: Entry hides both the sort key and satellite datum in private final ...
7
votes
4answers
164 views

Calculating a specific entry in a Pascal’s triangle recursively

Our task was to calculate the entry of a Pascal’s triangle with a given row and column recursively. The triangle was specified in a way that the tip of the triangle is ...
4
votes
4answers
193 views

Determining if a sentence is a palindrome

The biggest problem I see in checking palindromes on the Internet is when the user inputs a palindrome sentence or phrase and the program returns a wrong output. So for me, I tried to optimize ...
11
votes
6answers
295 views

Printing RPG Game Character Properties

I have written this code representing a class hierarchy of character classes, and a world class to print their properties. Is anything unclear about this code? Do ...
1
vote
1answer
32 views

JavaEE 7 with JPA (Hibernate) and JAX-RS (RestEasy)

below is a working example of code in which you can create car colors and cars using these colors with XML POST messages. And request all cars and colors formatted in XML using a GET message. I am ...
4
votes
2answers
54 views

Constructing a long string

I have a task to construct a long properly formatted string in Java. This string will be then used as a header of the logfile that we write during the program execution. As the program runs on server ...
3
votes
0answers
25 views

Simulating a GUI windowing system

I was eager to learn the implementation details behind windowing GUI systems. Because I am mostly a high level programmer having not much experience in low-level stuff, I had to simulate it instead of ...
0
votes
0answers
19 views

Parallel for loop in Java - follow-up 2

The previous iteration at Parallel for loop in Java 8 - follow-up. The changes are as follows: MyTask is removed. Synchronization removed. Now the user is ...
2
votes
2answers
35 views

Randomly pick a host from a list, subject to an uptime requirement

I have a POJO as shown below which will have hostname and other attributes. ...
7
votes
1answer
56 views

Implement stateless strategy pattern with enum being container

I am implementing a framework for validating orders. User creates a number of orders (Amazon orders for example), before he submits the orders and pays for shipment, whenever he revises anything, I ...
1
vote
1answer
79 views

Payroll Calculator Homework

I have written the code as best that I know how but I am unsure that the questions asked are being fulfilled. Any advice to improve this code would really help me. Question Asked: Create a new ...
3
votes
3answers
108 views

Find the missing number in a array

I'm working on a personal project to practice my programming skills and I came to this problem. I tried to create a program that will find the missing number in a array. I'm looking forward to ...
1
vote
0answers
47 views

Object counting sort in Java

The counting sort for integers counts the amount of each integer, then traverses the count entries in order, and for each entry inserts the integer representing the bucket into the array as many times ...
3
votes
1answer
46 views

Recursively parsing JSON response using GSON

I have a URL which I am executing it and it is returning the below string as a JSON response. I am using GSON to parse JSON. In the below JSON, "resourceId" ...
6
votes
2answers
82 views

Strategy Pattern Implementation

I thought I would learn a design pattern today and picked this one. I wrote a simple Android test demo to test the pattern. main.xml ...
-5
votes
0answers
29 views

Building a Triangle out of input in a for loop in Java [on hold]

*I need help making a triangle based on the output of the base of the triangle. For example When you put enter the size of the triangle it always prints the same size triangle, Please Help me * ...
0
votes
0answers
35 views

synchronize 2 jobs/processes [on hold]

I am having a continuously running server application which processes 2 jobs (file processing) which are completely different flows. I invoke the client giving either job 1 or job 2 so it could be ...
3
votes
1answer
38 views

3-way merge sort in Java

All those numerous merge sorts split the range in two halves. This is a modification that splits each range into 3 subranges. My demo suggests that 3-way merge sort is pretty efficient on large ...
1
vote
1answer
32 views

Parallel for loop in Java 8 - follow-up

The previous and initial iteration at Parallel for loop in Java 8. Changes are as follows: ParallelLoopBody removed; ...
3
votes
2answers
44 views

Multiple random falling objects animation in Java

I am new to programming but I tried to make my code as readable as possible! Hopefully you can see what it does before you run the program. I did not implement a ups or fps controller, the animation ...
-5
votes
1answer
30 views

Java Improving code efficiently [on hold]

ve used the following function in one of my programs. I have tried to make sure that my code is efficient however I cannot find any help online to tell me how to recognize where I could improve... ...
3
votes
2answers
68 views

Parallel for loop in Java 8

This is my first attempt to provide some syntactic sugar for doing mutually independent loop iterations in parallel. Thanks to Java 8 lambdas, I can write the parallel loops in pretty elegant fashion ...
1
vote
2answers
47 views

Check divisibility of each line in a large dataset

I have solved this assignment in online coding community, and it has run successfully. But it's showing 12.09s of execution. How could this be optimized ? The purpose of this problem is to ...
15
votes
3answers
1k views

I'm Simon, and this is what I say

Play my game! Having the name that I do (Simon), of course I have to participate in this challenge! (Even though I am a bit "late", but Simon says "have forgiveness!") This is an implementation of ...
7
votes
3answers
275 views

Simple random falling object animation in Java

I am new to programming but I tried to make my code as readable as possible! Hopefully you can see what it does before you run the program. I did not implement an ups or fps controller, the animation ...
10
votes
3answers
482 views

Coding multiples that equal 100

The objective was to see what numbers can be multiplied to equal 100. Example: 1 x 1 = 1 //no match 5 x 20 = 100 //match The objective (as I'm learning) was ...
5
votes
1answer
37 views

JFrame with four sliders

I am writing a control panel with Sliders but I think my code is messy and cumbersome, what can I do to improve it? ...
8
votes
1answer
59 views

Importing someone's Twitter feed

I used some Java code to work out how often MPs and Senators cited their sources in tweets. The results are at here and the GitHub for the whole project is here, and the Java code I use to download ...
6
votes
1answer
67 views

Custom TCP java proxy socket load balancer

I´m working on implementing a custom TCP proxy server which acts like a load balancer. The proxy server will accept client requests and then forward them to available hosts. I am concerned about the ...
3
votes
1answer
53 views

Morse Code Converter

I wanted an uncomplicated project to get myself started again. Although this works I was wondering if it's the best approach, especially when it comes to validation parts? It seems to me that I'm ...
-5
votes
0answers
20 views

Translate in a square [closed]

I have a car game that has a square donut as a race course. I want to make some dummy cars that will simply go around this square course and am running into some issues on the final turn that the AI ...
5
votes
2answers
34 views

Inserting values of Date type into a MySQL database

I have got a JTable implementing a TableModel interface. There are ID (primary key, ...
6
votes
3answers
109 views

HashMap with MySQL

I have faced a scenario: the task was to read a file which contains 3 Millions IP Address. There is a MySQL table which contains Id,PrimaryIP, ...
3
votes
1answer
67 views

Improving AI for a Connect 3 game

I am attempting to complete an assignment, which is basically Connect 3, instead of the classic Connect 4 game. The AI I am using is the exact same as the opponent, but the opponent wins more because ...
3
votes
2answers
53 views

BigRational based on BigIntegers

For Project Euler I've implemented a BigRational. The functionality is rather limited, just things I needed or will probably need soon. The style departs a bit from ...
3
votes
1answer
46 views

Android game setup

I've been working on a basic Android game these days, but I'm a bit uncertain about my setup and need some advice. The basics of the game are simple: there are characters running on your screen and ...
-3
votes
0answers
11 views

Java Wrapper for accessing Codebits API [closed]

I've developed a Java Wrapping tool for accessing Codebits API, and I would like to get some code review feedback. Here's the repo It's mostly about accessing an API endpoint through an HTML ...
5
votes
2answers
183 views

HashTable implementation

I have been trying to implement the Hash Table function in Java and here is what I came up with. I would just like to get an opinion on this work. Would there be a better way or any improvement to ...
5
votes
1answer
158 views

High/Low Guessing Game

This is my first by-self written code. Looking for advice on what not to or to do so I could deal with any bad habits now. It's a guessing game and works perfectly fine. I just wanted to know if more ...
1
vote
0answers
18 views

HashTable function implementation [duplicate]

I have been trying to implement the Hash Table function in Java and here is what I came up with. I would just like to get an opinion on this work. Would there be a better way or any improvement to ...
1
vote
2answers
51 views

Implement StringBuilder

I was asked this in an interview yesterday. I could add whatever methods, members and constructors I wanted but I couldn't change the signature of the provided ...
5
votes
1answer
62 views

Macroing program with Java

When you press CTRL you activate the "Register" mode. In this mode, when you click, the program stores the X and Y of the mouse. To turn it off, you press CTRL again. When you turn "Register" mode ...
4
votes
1answer
40 views

Three way Quicksort in Java

What do you think about this implementation of quicksort? Is it possible to make it shorter? ...
1
vote
0answers
18 views

Using HttpServltRequest to store a Request Scope map cache

I'm playing with CDI interceptors and thought use a interceptor to cache some methods in a managed bean: ...