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
1answer
692 views

Java: How to manage UDP client-server state

I am trying to write a Java application that works similar to MapReduce. There is a server and several workers. Workers may come and go as they please and the membership to the group has a soft-state. ...
0
votes
1answer
23 views

Is there an established pattern for associating a database entry with a Java class that executes on that data?

I have a behavior tree with different leaf nodes that execute tasks. When building out the tree relationship in the database I need an association between the leaf node entry and the Java class that ...
1
vote
1answer
129 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 ...
62
votes
3answers
24k views

Choosing between Single or multiple projects in a git repository?

In a git environment, where we have modularized most projects, we're facing the one project per repository or multiple projects per repository design issue. Let's consider a modularized project: ...
27
votes
2answers
1k views

How have Guava unit tests been generated automatically?

Guava has unit test cases automatically generated: Guava has staggering numbers of unit tests: as of July 2012, the guava-tests package includes over 286,000 individual test cases. Most of ...
115
votes
13answers
26k views

Should we avoid object creation in Java?

I was told by a colleague that in Java object creation is the most expensive operation you could perform. So I can only conclude to create as few objects as possible. This seems somewhat to defeat ...
0
votes
1answer
31 views

Architecture question about data migration

I'm facing a new enterprise project in Java about data migration. I did one of them in the past, now I want to do a better work and I think I need your considerations. So, let's me explain the ...
-4
votes
0answers
19 views

Cross platform application framework [on hold]

I am planning to develop a cross platform application that will run on all operating systems mainly windows desktop, Mac desktop, android and Apple mobile devices. What are the cross platform ...
-4
votes
0answers
28 views

I want to switch my programming platform [on hold]

I have worked as a ASP.NET developer(Web) for 4 years and I waked on Desktop applications as well(WPF). As everyone knows many things are taken care by .net framework and by Visual Studios, as days ...
-3
votes
1answer
35 views

How should I change in get method without calling getList() of Deque? [on hold]

import java.util.List; import java.util.ArrayList; public class Test { /** * @param args * @throws Exception */ public static void main(String[] args) throws Exception { ...
0
votes
2answers
71 views

Classic ASP to Java UI Conversion

My question is based on a business model of a financial services organization that currently is supporting applications that are a hybrid mix of Classic ASP and Java, with some JSP’s already in some ...
1
vote
2answers
109 views

Is it better to perform a calculation in the field's setter or have a different method?

I'm implementing a simple Quota object which determines a usage percentage based on the maximum and the used. private int maximum; private int used; public Quota(int used, int maximum) { ...
0
votes
1answer
91 views

Enum as singleton or fully functional class [duplicate]

Joshua Bloch claims that "a single-element enumeration type is the best way to implement a singleton" Why? I totally disagree with this statement because enumeration is data type with some ...
-2
votes
0answers
32 views

Design pattern for Login Online and offline [on hold]

I am new to Software Design patterns, I am developing an application in which user may liggedin offline or online depending on internet connectivity... so which design pattern will be best solution ...
23
votes
8answers
10k views

Why was Scala not implemented with C or C++

Does anybody know why was Scala implemented in Java and .NET instead of C or C++? Most languages are implemented with Cor C++ [i.e Erlang, Python, PHP, Ruby, Perl]. What are the advantages for Scala ...
22
votes
6answers
23k views

Difference between a service class and a Helper class

I would like to know what differentiates a Service class from a utility class or a helper class? A class only with underlying methods calls the dao's is a service? Doesn't the usage of Helper ...
0
votes
0answers
63 views

Transaction Management in Hibernate with DAO Design Pattern

I have many Tables, For every Table,we have DAO Interface and DAOImplementation class. Example DAO Interface public interface CancelPolicyDAO { public CancelPolicy insertCancelPolicy(CancelPolicy ...
1
vote
1answer
257 views

From a DDD perspective is a report generating service a domain service or an infrastructure service?

Let assume we have the following service whose responsibility is to generate Excel reports: class ExcelReportService{ public String generateReport(String fileFormatFilePath, ResultSet data){ ...
-3
votes
0answers
23 views

Suggestions for Subscription-Based Software Product Licensing [on hold]

Can anyone suggest some solutions or products for doing subscription-based software product licensing? We have used dongle-based solutions in the past but, with the proliferation of virtualization, ...
-1
votes
0answers
36 views

Advice needed on Selecting Server VS Cloud [on hold]

I am having a big issue. Imagine that I am planning to launch a local social media site. You know what it is, multiple users, lot of data uploads (ie: photos, notes, etc). However I am having a hard ...
-1
votes
0answers
13 views

How BeanPropertyRowMapper works internally in spring?

I know that BeanPropertyRowmapper use setter method when I fire select query but is it uses getter method too or not ? I don't want to make my custom row mapper or hibernate or JPA. I have face below ...
52
votes
11answers
6k views

Did the developers of Java consciously abandon RAII?

As a long-time C# programmer, I have recently come to learn more about the advantages of Resource Acquisition Is Initialization (RAII). In particular, I have discovered that the C# idiom: using (var ...
10
votes
4answers
796 views

Good implementation strategies for encapsulating shared data in a software pipeline

I'm working on re-factoring certain aspects of an existing web service. The way the service APIs are implemented is by having a kind of "processing pipeline", where there are tasks that are performed ...
-4
votes
0answers
49 views

About primitive types in java [duplicate]

I see that Java has Boolean (class) vs boolean (primitive). Likewise, there's an Integer (class) vs int (primitive). What's the best practice on when to use the primitive version vs the class? Should ...
0
votes
1answer
106 views

Should I use one class that calls Several static methods or several classes each calling one static method

I need to use instances which represent mathematical functions along with their parameters end enable their evaluation. I can take 2 approaches: 1: have a single class representing all the math ...
1
vote
2answers
140 views

How to add rigor to my testing?

I work on a small/medium sized Java application. Over time, I've tried to ensure that the tests which I write are "good" tests, and that there's plenty of them. Hence I've been looking into various, ...
-2
votes
0answers
40 views

Java : Error: A JNI error has occurred, please check your installation and try again [closed]

I am trying to run a new application which requires Java (Kaazing) and keep getting this error on startup "Error: A JNI error has occurred, please check your installation and try again" I have ...
2
votes
7answers
14k views

Understanding the difference between mutable and immutable classes

I faced this question in one interview. I explained that String is immutable and StringBuffer is mutable class. I don't know very much about mutable and immutable and also don't know the exact answer. ...
26
votes
13answers
2k views

Does the use of debuggers have an effect on the efficiency of programmers? [duplicate]

Possible Duplicate: Are debugging skills important to become a good programmer? I'm a young Java developer and I make a systematic use of the Netbeans debugger. In fact, I often develop my ...
1
vote
0answers
91 views

Finding ArrayList elements in ArrayList [migrated]

I have two ArrayList userActions and actionsToCheck of type enum Action. I want to check if all the elements in actionsToCheck is present in userActions. Is the following good enough or is there a ...
1
vote
0answers
27 views

Individual methods or parameters for Google Analytics abstraction on Android

A coworker and I are having a discussion around the best way to build our abstraction on top of Google Analytics for an Android application. A couple of data points. We have auto-tracking enabled ...
0
votes
1answer
470 views

HTTP Session: A single object or multiple?

I tested two approaches to store session data: The classic: 1 key, 1 object (And every key as static final String in a class) "user" --> UserObject "preferences" --> List ... An ...
-4
votes
0answers
47 views

Sending binary data along with a REST API request [closed]

The problem is I need to send binary data (for example multiple images) and some metadata information together. I am using REST based web-service.
1
vote
2answers
84 views

Java applets with Safari on Windows as compared to Safari on OS X

I have a developed an Applet which works fine on Chrome/IE/FF on Windows. I am not expecting any users for Safari on Windows but there might be the odd user who may be on a Mac. As of now, I don't ...
14
votes
8answers
36k views

Why does java.util.ArrayList allow to add null?

I wonder why java.util.ArrayList allows to add null. Is there any case where I would want to add null to an ArrayList? I am asking this question because in a project we had a bug where some code was ...
-4
votes
2answers
100 views

it is possible to implement keyloggers in java [closed]

I am researching on keyloggers and as a part of my research I would like to know if its possible to implement keyloggers in java edit * How can i create a keylogger in java or to be precise what ...
0
votes
1answer
103 views

Implementing a NoSQL and RDBMS compatible DAO

What would be the correct way to design a DAO which implementation is first going to be targeting a MS SQL database with a STAR model, but yet, business requirements specify the application must be ...
13
votes
7answers
2k views

Is there a pattern for a more “natural” way of adding items to collections? [on hold]

I think the most common way of adding something to a collection is to use some kind of Add method that a collection provides: class Item {} var items = new List<Item>(); items.Add(new ...
8
votes
3answers
10k views

Is Java free/open source or not?

On November 13, 2006, Sun released much of Java as free and open source software, (FOSS), under the terms of the GNU General Public License (GPL). On May 8, 2007, Sun finished the process, making all ...
-3
votes
0answers
73 views

learning C++,PHP and Java at the same time? [closed]

I LOVE programming, i want it to be my career and my life, that's how much i love it, but here is the problem, our school system in my country only taught VB6 and QB (yes QUICK freaking BASIC), so i ...
-2
votes
0answers
20 views

How to use jquantlib with eclipse? [closed]

I'm currently beginning to work on my masters project in quantitative finance and I wanted to use jquantlib for my work. I've searched the internet quite a bit but couldn't find good understandable ...
3
votes
3answers
472 views

Should I try it straight or should I first check if it can be done?

I have a set of items, and each item in the set must be unique. Item are composed from multiple properties and each property of each item can be changed. But after each change every item in the set ...
-3
votes
1answer
48 views

How to start developing android app? [closed]

I want to start developing an android app. From where should I start? I have knowledge of Rest based web-service and I want to integrate it with my android app. I have a very clear picture of what I ...
0
votes
2answers
100 views

Printing to out vs Logging, given the nature of this app?

I'm writing a command line application in Java. That app will scan a list of remote resources, do several attempts to access those resources, report failed attempts, and if succesfully accesed, ...
-2
votes
1answer
34 views

Help with static checking of signed longs and Java 8 “pseudo-unsigned” longs [closed]

How can I use the pseudo-unsigned longs in Java 8 without all the bugs I've been having to hunt down? I know of the Long.divideUnsigned()/compareUnsigned() functions (and use them -- this is part of ...
3
votes
1answer
159 views

Database Password problem when using GIT to manage project that uses Spring to initiate Datasource

I use Spring Framework to code my Web Service, using Dependency injection to inject a DataSource bean into the DAO bean that will be used by the Web Service. I have all the database properties(Url, ...
0
votes
2answers
99 views

Saving to file before storing into a database in a REST service

A mobile back-end I am building should receive a larger amount of data (some sensor recordings) from an Android phone. The phone does not have much use of it so it was most efficient to store the data ...
1
vote
4answers
160 views

Options for constructing an object that is not logically initialized until all fields are set

I am working on a Pokemon game at the moment, and am running into some design concerns. The easiest example is as follows: Each Species of Pokemon has several traits that are required before it is ...
1
vote
1answer
102 views

Automatic Type Promotion in JAVA

I have started studying JAVA . In there, byte ch=50; ch*=2; works fine. But byte ch=50; ch=ch*2; does not. error:possible loss of precision required:byte found:int Why this do not happen ...
0
votes
1answer
107 views

Dealing with several custom getters

I have a data structure with data units containing different types of data. I've wrapped the data in "Field" objects so that each field is able to independently parse user input in a desired way. ...