Java is a high-level, platform-independent, object-oriented programming language originally developed by Sun Microsystems. Java is currently owned by Oracle, which purchased Sun in 2010.

learn more… | top users | synonyms

0
votes
0answers
30 views

Is it possible to miss a connection?

I'm writing a simple asynchronous tcp server & client program and I am curious if it's possible that the method "waitForConnections" misses a connection because it's still busy with accepting the ...
3
votes
4answers
115 views

Design strategy for wrapping exceptions

I'm implementing a type of Repository for a framework/library that has (roughly) the following: public interface FooRepository { boolean contains(String id); Foo fetch(String id); void ...
21
votes
6answers
3k views

Is throwing new RuntimeExceptions in unreachable code a bad style?

I was assigned to maintain an application written some time ago by more skilled developers. I came across this piece of code: public Configuration retrieveUserMailConfiguration(Long id) throws ...
-5
votes
0answers
38 views

Auto Moving Objects using Java [on hold]

Hi guys i am new to this field, but i am willing to learn java. So i have chosen games to learn java i am developing a game called Shooter, which requires images to move in its own...... So someone ...
2
votes
1answer
135 views

Finding the closest n points to any arbitrary point in two dimensions (r-tree, quadtree, spatial index)

I have a distribution of two dimensional point objects. How is it possible to find the nearest N number of points to any given point without iterating over the entire collection of points (and only ...
-5
votes
0answers
43 views

How to develop logics in java programming? [on hold]

I am working as a Manual Tester from 3years,I feel it is right time for me to choose a career in Automation. As a part of it I have selected 'Selenium with JAVA' is the best platform to enhance my ...
2
votes
1answer
362 views

DataMapper for a MMO game plugin to send packets

I am working on an plugin for some game-server. The information about the plugin is not really necessary. Few points you might find helpful to answer to this question: The server The server is ...
1
vote
0answers
75 views

Approach for polyglot logging

I'm building a desktop app with a Java front-end and very performance critical Fortran libraries. We've recently started pushing more of our code out of Java and into Fortran (see below) Soon we will ...
0
votes
1answer
50 views

JEE MVC, controller calls the interface instead of the interface implementation

I'm following this tutorial: http://wiki4.caucho.com/Building_a_simple_listing_in_JSP It creates a basic web application in Eclipse using the MVC pattern with Resin as the web container. Here's the ...
0
votes
0answers
26 views

Queries regarding getting a job as a software developer [on hold]

I'm Computer Science Fresher and is looking for a good job in software devlopment. I know topics like Core Java, C++, data structures, SQL etc. I have following queries - 1) Should I learn ...
-2
votes
0answers
13 views

java.util.ConcurrentModificationException while removing items from collection [migrated]

I am learning Java's Collection framework. I wrote this little program to check why we can't use For-each to remove elements. Code: import java.util.ArrayList; class intro{ public static void ...
1
vote
2answers
161 views

Java difference between String a = null and String a = new String()

It a pretty naive question to ask but I got this doubt while programming for android. I use to initialize my new strings like String a=null, so in my code there remains a probability to get ...
1
vote
1answer
131 views

Non-fixed-size Fenwick Tree implementation

I'm planning to implement a non-fixed-size Fenwick tree. That is, a Fenwick tree that allows interleaving range queries with adding/removing elements. All implementations and samples I've seen so far ...
-3
votes
0answers
16 views

Please recommend an IDL/RPC framework that works with Java and Python [on hold]

I'm looking for a framework that supports RPC from Java to Python, where the message format can be defined via a simple IDL. My requirements are: Must be high performance Must support streaming ...
2
votes
1answer
152 views

Design pattern for ensuring the “signature” of generic lists is equal

I have an interface, Attribute, that is going to be implemented in various ways, class AttributeA implements Attribute{\\..} class AttributeB implements Attribute{\\..} Then I'm planning to have ...
1
vote
1answer
85 views

Polyglot Node.js with Typesafe Akka for Actor Model

I have a case that needs to manipulate a large stream of JSON and inject it into Apache HBase. Our system works on Node.js with Mongo then, since we need to enhance performance, so HBase is choosen to ...
1
vote
0answers
40 views

How long to learn Java EE if I learnt Java SE? [on hold]

I hope I did post at the right category for my question. First of all, I am currently looking for a job and from what I see is that there is quite a demand for programmers knowing Java EE rather than ...
3
votes
3answers
187 views

Is enum order sensitivity an antipattern?

Is it an anti-pattern to depend on a particular order of an enum's instance declarations? For example, consider: public enum CompassPoint { North, East, South, West; } These points ...
1
vote
1answer
205 views

What would be the best way to implement priority based programming without adding too much of if-else processing logic

We need to add priority based programming in our application using java programming language. For example, there are three priorities that a phone can have: A1, A2 and A3. Also there can be three ...
0
votes
2answers
610 views

Is factory pattern a right pattern for the situation described here?

Is factory pattern a right pattern when we want to consolidate the related objects? Problem - In the Set-top box, I have a user-io, basically the interface to control the settop box - The user-io can ...
1
vote
3answers
136 views

Should class with only static data need to be instantiated?

I have two classes. 1. Node 2. MixedStateManager Node class: Node class maintains the state of nodes in the system. One such data is state. public class Node { private int state; ...
2
votes
1answer
67 views

Define an object with the interface as a type instead of class name [duplicate]

I try to practice with the design patterns and explore one of the possible implementations of the Observer Design Pattern in Java. I paid attention, that in this example the object is defined with the ...
1
vote
0answers
35 views

How to design an interface for two similar but distinct objects

I'm designing an API for a JavaFX control to be submitted to the ControlsFX library. This control is called the ViewManager, and its purpose is to hold a collection of View instances, all of which ...
3
votes
1answer
209 views

Debugging xml and annotations

By now, most web containers have an annotation variant of their xml configurations for Java EE. I'm guessing this is because it's better to keep things in Java where they can be managed, coded with ...
1
vote
1answer
164 views

Is a class representing a JSON response a DTO, a domain object, or something else?

Consider a restful service in Spring MVC. I am wondering how to package my response classes, i.e. how to name the containing package. First I thought of them as being domain objects. But they are ...
0
votes
0answers
15 views

Database search results by deviation from query in Java

When every i try something new, I always 'throw myself in the deep end'. I'm in the initial stages of an android app build (my first android app, and first attempt at anything java) I want to know ...
24
votes
8answers
4k views

Is there a conventional way to combine file path strings?

In an example: var assets = "images/" var sounds = assets+"sounds/" Is it more conventional to put the slash on the back of a file path? var assets = "/images" var sounds = assets+"/sounds" Is ...
3
votes
1answer
342 views

Is this database design good? What JPA Entities should I create for this design?

I am trying my hands on JPA. For this I am thinking of using the example of a student admission process as shown in the diagram below. Is this design good ? Any suggestions for improvement are ...
1
vote
0answers
18 views

How to get and save Wordpress content (html, css, images, videos) from a Java program? [migrated]

I apologize if it's not the good place to ask this question. Please if it's not help me to find where I have to ask it. So here is my challenge. I need to get and save Wordpress content (html, css, ...
1
vote
0answers
56 views

Simulating fluid transfer in a pipe [on hold]

I know this is a fairly large/broad category, but I've been racking my brain over the last few weeks on how to simulate fluid flowing through pipes. In the environment I'm working, I can have a single ...
0
votes
1answer
104 views

If everything is supposed to be an object in Java (barring primative types), isn't this contradicting the point of static? [duplicate]

I often write code which makes an object and then use static methods in static classes to manipulate said object. Am I missing the point of OOP? How do I know whether I'm thinking in the OOP mind ...
5
votes
0answers
51 views

Optional features: default method or separated interface

Dedicated interfaces seems to be a good way to expose the optional features in a domain-specific type hierarchy. However, they impede the use of decorator and composite patterns, which is also common ...
2
votes
1answer
61 views

Distributing a modified OpenJDK class with a proprietary app

I want to distribute a Java class I borrowed from the GPLv2'ed OpenJDK and modified for my own needs as a part of my proprietary application. The header at the top of the source file states (and I've ...
-3
votes
0answers
22 views

what technologies and architecture used to develop erp [on hold]

nice day for all if i start develop new erp using java its be desktop application 1- what technologies i should use in ? 2- can you give me architecture for it? 3- are erp is distributed system ? ...
1
vote
1answer
40 views

Distributing a proprietary app together with an ASLv2'ed derived work

My proprietary Java app includes a modified version of a 3rd party library distributed under Apache Software License, version 2.0. The 3rd party library doesn't come from the Apache Software ...
-1
votes
0answers
29 views

Extracting Headings and paragraphs separately from xml files in Java [on hold]

I first converted the xml file to a string and then tried searching for specific tags in the file. However, the string files are incredibly long (about 1.5 billion characters), so the search often ...
-6
votes
0answers
27 views

Java for web application [on hold]

I want to start Java Web application.how to start I have a little knowledge of java programming Can someone help me step by step. It means that how to prepare for jsp
-5
votes
0answers
30 views

Desktop application to access HTML files [closed]

I am planning to design a desktop application which will access an HTML file,take data from it, then store the data after some logic in excel. I have some queries regarding that. Which language can ...
1
vote
0answers
29 views

Best JavaFX Pane of Structure for a Graph?

I will preface this question by saying that I am studying math and computer science at a university, but I have never been very good with graphics. I want to create a window that generates a square ...
0
votes
2answers
78 views

Getters with data conversion in Java VOs

I am working on a standard Spring application where DAO layer returns entities to service layer and service layer returns VOs to other services and controllers. In a certain scenario, we have a VO ...
2
votes
2answers
198 views

private method that uses no instance members - better static? [duplicate]

I have a private helper method that uses no instance variables or methods, I feel it would be less confusing if it was static (this way, it's given fewer points it can access). I am a bit unsure if ...
-2
votes
0answers
36 views

Data Driven Validation/Rule Engine in JAVA [on hold]

I have data and series of validation (Business logic) before I can use it further. Like following :- { "site" : "UK", "domain" : "xyz.UK", "currency" : "DOLLAR", "type" ...
-2
votes
1answer
112 views

Does 'Iterable' interface look redundant in java? [on hold]

By this below definition(pre 1.8) of Iterable, package java.lang; import java.util.Iterator; public interface Iterable<T> { Iterator<T> iterator(); } I would say that, Iterable ...
-1
votes
2answers
86 views

Using nulls as Android application logic [closed]

I'm developing some Android applications. I am using null objects as the application logic. Is this approach okay or should I take another one and which one? Example: I use null objects logic when ...
0
votes
1answer
41 views

How to better isolate JOGL or LWJGL3 dependency from game clients?

I'm currently working on a project to develop a relatively small framework with the goal of supporting game development efforts for students in a course. The scope of this project is an OpenGL-based ...
0
votes
3answers
104 views

Surface Area calculations

For my program, I implemented AABB collision which works fine. When AABB collision detects a collision between 2 boxes, I want to find the surface area of portion where the 2 boxes are overlapping. Is ...
-7
votes
0answers
30 views

What editor should i use to code ,compile and execute a java script scripting language? [closed]

I have learnt C and C++ languages . Now I want to learn java script like we have turbo c or c language what software should i download to learn java script?
0
votes
1answer
42 views

Promise Akka Play Java Sequence

I have an actor which is having three asynchronous web service calls. Lets say A,B and C. All return promise objects which has their respective response. I added loggers processA,processB,processC ...
-3
votes
0answers
61 views

Developing android app that can communicate each other [closed]

My Objective I want to create two android applications that can communicate each other. Let's call them Application A and Application B for now. Application A will have some buttons which will send ...
53
votes
10answers
17k views

Why is String immutable in Java?

I couldn't understand the reason of it. I always use String class like other developers, but when I modify the value of it, new instance of String created. What might be the reason of immutability ...