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

-1
votes
0answers
20 views

developing a cryptographic algorithm

Can we develop an encryption/decryption algorithm which changes the session key automatically for every wrong attempt of trying to hack it? I only found a workaround of the same but keen to find an ...
2
votes
1answer
61 views

Parameterized Java Types (Generics)

Consider this "legacy" code: public interface IPersistentCollection { IPersistentCollection cons(Object o); } Genericized in Java, it could become something like this: public interface ...
0
votes
2answers
67 views

Handling multiple packet types in Java 8

I have a Netty-based game server implementation that handles 40 or so distinct packets with their own serialization structure, for brevity I'll refer to them as FooPacket, BarPacket, ... These packet ...
1
vote
0answers
24 views

Using Mockito.reset

I've just read a lot of arguments against using Mockito.reset and can't make much sense of it. Put differently, I agree in general, but there's always a case which looks like using reset is useful or ...
-3
votes
0answers
45 views

career path for java progammer in embedded system [on hold]

I hav completed my BE in computers,certified in java. Opting for embedded system . What is the career scope for java programmer in embedded system?
0
votes
3answers
112 views

How should be the approach to start thinking about multi thread programming [on hold]

I am an experienced java developer.Of now I have started learning multithreading in java.I am able to grasp most of the concepts but still I am unable to visualize applications running on threads.I ...
1
vote
1answer
61 views

Why is Throwable initCause designed to be called only once?

I find it really odd that the initCause method of Java's Throwable class can only be called once, or even not at all (if the constructor accepting a Throwable was used). This makes exception chaining ...
0
votes
2answers
62 views

C++ Data Server and J2ME client communication

I am working on a robot that has some AI built in. However, the mandated robot controller does not have the power to do the work onboard. This means that I need to use a co-processor. I am writing ...
1
vote
0answers
116 views

Emulate enviroment locally or accept use of a dev enviroment [on hold]

I'm at a new job and I really want to set up my VM to be able to emulate some or all of the enviroment locally. I'm told it's not possible, but I hate to accept that. To give some context, I'm very ...
-3
votes
0answers
32 views

Eclipse Luna not starting? [on hold]

I downloaded Eclipse Luna, unzipped the folder it was in, and tried clicking the executable to start it. It did not open at all, but I can start the program from the command line. I am using 64 bit ...
1
vote
2answers
200 views

Java: how can I make the return type, of an inherited method in a subclass, the same as the subclass?

I am rather inexperience in Java, and I'm having a problem in forming a subclass of a class I have created. The class I have made, called Vector2D, contains methods, such as add(Vector2D addend), that ...
-1
votes
0answers
52 views

Best approach to code organization on a personal Java project [on hold]

To start off with, I'd like to say that I'm no Java expert, but I do know programming logic. This question is related to code organization rather than the code itself. I want to build a tool to help ...
-4
votes
0answers
80 views

Why use Java in a greenfield project when you know Scala? [on hold]

Are there any computer science reasons why a good Scala developer would need to revert back to Java these days? I am assuming we are talking about a greenfield project and do not include using Java ...
0
votes
1answer
90 views

How to find bus routes? [on hold]

I am doing to find Bus Routes, moreover transit route. Like the Google map, enter From location and Destination location. Program calculated and show possible and best routes by order. Info already ...
-5
votes
0answers
60 views

I want code for text box or combo box which shows drop down list while we typing.. like Google search engine [on hold]

How to enable dropDown option, when we Type in inputbox it should show corresponding data from database..
0
votes
1answer
101 views

Ajax call or js to update a cart price

I am building a cart in Java and would like to give users the ability to update the quantity and see the new price instantly. I am using BigDecimal on the back-end for complete accuracy, but the ajax ...
-3
votes
0answers
45 views

java programs with 3D navigation display [closed]

Am a newbie java program, writing a program with java that has to do with map of a location that communicate with a GPS device, please i need to know how to go about it if source code can be provided ...
0
votes
0answers
24 views

understanding evaluation function [closed]

I am developing a chess program. And have made use of an alpha beta algorithm and a static evaluation function. I have successfully implemented both but I want to improve the evaluation function by ...
-4
votes
1answer
100 views

Try and catch error trapping, why is it so significant? [duplicate]

I try to understand why should I "try" a method to catch errors. It looks to me like the concept is: "letting a process run assuming its not properly developed". Should I always assume that a ...
-1
votes
1answer
98 views

How to implement a genetic algorithm with distance, time, and cost [closed]

I want to make a solution to find the optimum route of school visit. For example, I want to visit 5 schools (A, B, C, D, E) in my city. Given the choice of five routes regarding what school I should ...
1
vote
1answer
120 views

What is the difference between Callback<T> and Java 8's Supplier<T>?

I've been switching over to Java from C# after some recommendations from some over at CodeReview. So, when I was looking into LWJGL, one thing I remembered was that every call to Display must be ...
-1
votes
0answers
77 views

Credit Card Payment Processing which APIs do you use? [closed]

It's for a Point of Sale Terminal where the customer will bring the physical credit card and it will be swiped through the terminal. The business has a merchant account on some banks. So, how do I ...
2
votes
1answer
95 views

What do I have to do when using libraries with BSD license?

I am making a game using LWJGL and this is their license. What I don't understand is what must I do? I plan on making a game and distributing it, not the source code just the .jar file and maybe sell ...
-4
votes
0answers
26 views

Problem in searching String array [closed]

I'm working on a bank interface project, where I have to search an array of string when the user types in his username. The array has 10 strings, but only the first string is recognized as a valid ...
-3
votes
0answers
24 views

Is there a replacement of inbulit getpixels method (of Java) in Objective C? [closed]

I've to get some data from image. In Java, this has been done using the following method where p1 is object of class pixels. p1.pixels, p1. width, p1.height all return the answer in int. Can someone ...
21
votes
12answers
5k views

Why does void in C mean not void?

In strongly-typed languages like Java and C#, void (or Void) as a return type for a method seem to mean: This method doesn't return anything. Nothing. No return. You will not receive anything from ...
1
vote
2answers
149 views

Instantiating objects in Java [closed]

I'm learning now Java from scratch and when I started to learn about instantiating objects, I don't understand - in which cases do I need to instantiate objects? For example I'm studying from TutsPlus ...
-4
votes
0answers
36 views

Eclipse Maven Java project upgrade [closed]

I am picking up an existing Java project, which was developed within Eclipse HELIOS (2011) with JDK 1.6, Tomcat 6, Maven (m2e) apache-maven-2.2.1. How to upgrade the project with the latest Eclipse ...
1
vote
1answer
63 views

Tomcat + Spring + CI workflow [on hold]

We're starting our very first project with Spring and java web stack. This project will be mainly about rewriting quite large ERP/CRM from Zend Framework to Java. Important factor in my question is ...
-3
votes
0answers
30 views

How to swap or move 2 string in Array? [closed]

I have a need to convert .csv file to .dat file. In my problem, there are value pairs, with a name attribute (called Fund) and corresponding numeric value. If the input file has a pair whose value is ...
-4
votes
0answers
45 views

Travelling salesman algorithm in java [closed]

How to find all the permutation of cities in Travelling salesman problem? I can't understand the logic how it is achieve by bitmask. How we solve the problem if reputation of cities is allowed.
-2
votes
0answers
61 views

Maximum tcp port number constant in java [migrated]

Is there a public constant for the maximum TCP port number (65535) defined in java or a common library such as Apache Commons, that I could refer to from my code (instead of using the integer ...
1
vote
1answer
86 views

Embedded Tomcat Cluster

Can someone please explain with an example how an Embedded Tomcat Cluster works. Would a load balancer be necessary? Since we're using embedded tomcat, how would two separate jar files (each a ...
1
vote
2answers
152 views

If there's no problem treating a statement as an expression, why was there a distinction in the first place in some programming languages? [duplicate]

Why do we have the distinction between statements and expressions in most programming languages? For example, in Java, assuming f and g return ints, this still won't compile because it's a statement ...
-2
votes
0answers
35 views

How to manage the images for my Desktop Application [closed]

What's the better way to manage the image files of my app? i've been thinking about the way that i do right now (save the image as a BLOB IN db), and i ask myself if would be better to manage the ...
1
vote
2answers
68 views

Need to organize words based on their components, any other way aside from brute force?

I'm not sure if this process has a name. I have some words (about 9,000). They are in Japanese, but I'll try to explain this using English words. I want to categorize the words by the components (in ...
0
votes
2answers
173 views

Can regexp be used to check for palindromes?

Can regexp pattern matching be used to check for palindromes within a given text in Java? My intuition is that in order to check for palindromes, we may need to remember the character that was ...
1
vote
2answers
43 views

Should I reference a CopyOnWriteArraySet from the Set interface?

There are two ways to use a CopyOnWriteArraySet: // A Set<Object> set = new CopyOnWriteArraySet<>(); and // B CopyOnWriteArraySet<Object> set = new CopyOnWriteArraySet<>(); ...
0
votes
1answer
69 views

Prepared statement alternatives for this middle-man program?

I have an program that is using a prepared statement to connect and write to a database working nicely, and now need to create a middle-man program to insert between this program and the database. ...
0
votes
1answer
118 views

API always returns JSONObject or JSONArray Best practices

I'm making an API that will return data in JSON. I also wanted on client side to make an utility class to call this API. Something like : JSONObject sendGetRequest(Url url); JSONObject ...
2
votes
3answers
201 views

Decoupling software components via naming convention

I'm currently evaluating alternatives to refactor a drivermanagement. In my multitier architecture I have Baseclass DAL.Device //my entity Interfaces BL.IDriver //handles the dataprocessing ...
4
votes
2answers
242 views

Does this factory method pattern example violate open-close?

In Head-First Design Patterns, they use a pizza shop example to demonstrate the factory method pattern. public abstract class PizzaStore { public Pizza orderPizza(String type) { Pizza pizza; ...
0
votes
2answers
106 views

How to avoid or minimise use of check/conditional statement in my scenario?

I have scenario, where I got stream and I need to check for some value. If I got any new value I have to store it in any of data structure. It seems very easy, I can place conditional statement ...
0
votes
3answers
132 views

How to change the state of a singleton in runtime

Consider I am going to write a simple file based logger AppLogger to be used in my apps, ideally it should be a singleton so I can call it via public class AppLogger { public static String file = ...
0
votes
2answers
106 views

API Class with intensive network requests

I'm working an API which works as "intermediary" between a REST API and the developer. In this way, when the programmer do something like this: User user = client.getUser(nickname); it will ...
1
vote
1answer
207 views

Implementation of instance testing in Java, C++, C#

For curiosity purposes as well as understanding what they entail in a program, I'm curious as to how instance testing (instanceof/is/using dynamic_cast in c++) works. I've tried to google it ...
1
vote
0answers
48 views

How to tidy up a massive spaghetti project [duplicate]

I previously asked this on StackOverflow, but was advised it was a better fit for Programmers. I have recently begun working on a codebase (as a Java developer) with the following characteristics: ...
1
vote
1answer
162 views

Design for object with optional and modifiable attributtes?

I've been using the Builder pattern to create objects with a large number of attributes, where most of them are optional. But up until now, I've defined them as final, as recommended by Joshua Block ...
0
votes
0answers
4 views

Populate date to jList in netbeans (Java) [migrated]

I created a jFrame using netbeans, Here is a screenshot on how i want the data to be added in to jList, From A to B. Can you show me how i can do it?
0
votes
1answer
84 views

Reflective discovery of an inner class in an API

Let me ask you, as this bothers me for quite a while but appears to be subjectively the best solution for my problem, if reflective discovery of an inner class for API purposes is that bad idea? ...