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

Design a Queuing Solution with Clustering and Multiple Consumers

It is a Design Problem which I am listing out here. I have different set of business operations that are carried out for different business entities. Operations: Operation A Operation B Operation ...
1
vote
0answers
543 views
+50

Thoughts on refactoring a generic DAO

I have designed a generic DAO in Java and am having confusion about whether to refactor it to different design or not. PS Don't say to use already existing 3rd person framework. I know there are some ...
0
votes
1answer
32 views

excute Vs excuteOnExecutor

There are two ways to execute AsynTask, i.e., execute and executeOnExecutor. I already know that execute works serially and executeOnExecutor works in parallel. So my question is: Which one to use? ...
4
votes
2answers
58 views

Design solution for communicating between multiple layers

We are developing a framework that has several layers and would be deployed in a multi-threaded environment. Each layer may have its own input/output data type. The top layer takes the input, performs ...
0
votes
1answer
24 views

JUnit3 and JUnit4 in the same project (but different module)?

I have an Android project with a Gradle build. We've decided to commit to writing a vanilla Java implementation of our business logic (since we took care to keep that divorced form the Android ...
-1
votes
1answer
23 views

Multiplayer in Android [on hold]

I am developing an android game wherein four player will connect to each other, the player must be only be on the same LAN or Network. My problem is I really don't know where to start? Whenever I ...
1
vote
1answer
426 views

JSP Include: one large bean or bean for each include

I want to refactor a webapp that consists of very distorted JSPs and servlets. Because we can't switch to a web framework easily we have to keep JSPs and Servlets, and now we are in doubt how to ...
1
vote
1answer
61 views

Overriding methods by passing as argument the subclass object where the supertype is expected

I am just learning Java. Not a practicing programmer. The book I am following says, that when overriding a method, the argument types must be the same, but the return types can be polymorphically ...
-5
votes
0answers
57 views

How JIT is faster than that of interpreter in JVM? [on hold]

Please describe above problem for the following given program. print a; print b; repeat the following 10 times by changing i values from 1 to 10; print a;
2
votes
1answer
96 views

Object caching in this code too expensive?

I'm having some trouble with a game developed in Java which is kinda slow. I benchmarked it a little bit and found the problem: most of the time, the JVM is in the Object.<init>() since there ...
0
votes
1answer
127 views

What'd be better? To add one more local variable, or to call a method twice in general case?

I have the method which returns java.util.Date inside the hibernate-entity class: package ua.com.winforce.loto_partner.commons.db.entity; @Entity @Table(schema = "pr", name = "publice") public class ...
1
vote
4answers
2k views

Working with static constructor in Java

I didn't get a complete understanding of static constructors in Java. If it is allowed, why it is allowed? In what scenarios would you use it? What purpose would it serve? Can someone give me a simple ...
0
votes
2answers
141 views

Making subclass more type-specific with accessors

I have a super class: TriggerManager with a subclass TimedTriggerManager. NOTE: I'm working in java TimedTriggerManager only deals with TimedTrigger s, a subclass of Trigger. TriggerManager ...
0
votes
1answer
33 views

Java Doc - Do fields also get documented?

This is a really simple question but oddly, I'm finding it difficult to get a definite answer.... What do you do with fields? Is this valid? /** * Keeps track of all usernames in the system. */ ...
0
votes
2answers
157 views

Development on Android without using Java

As the title of this question suggests, I am looking forward to develop app(s) on Android platform without using Java at all. It doesn't mean I have some kind of vendetta against this beautiful ...
0
votes
0answers
22 views

Best approach to save relationship mapping of country,state,city in orm

I am building a project in play framework java with jpa and I want set country,state,city dropdown fields in a form to be dynamic(from database).So only admin can increase or decrease the value of ...
-3
votes
1answer
1k views

How does Java handle integer overflows and underflows?

Does Java handle integer overflows and underflows? If so, how does it handle these?
1
vote
2answers
511 views

The better way to ask for input?

I am wondering which is the best way to go with java code. I need to create a class with simple prompts for input.. I have tried using both classes and cannot work out the particular benefits for ...
-4
votes
0answers
25 views

Is there a modern incarnation of the Java Web Start CD-Install page? [on hold]

The Java Web Start Guide used to include a page describing how to make a Web Start application installable from external media, but that page isn't in recent versions of the documentation. Is an ...
0
votes
0answers
8 views

Incrementing a string [migrated]

How do I take an input and increment each letter by one e.g "ABC" to "BCD" in Java. I have attempted below to try and change the string to an int and then increase the value by 1. import ...
-5
votes
0answers
15 views

Java writeLock() [on hold]

How to determine if writeLock section is already busy? I mean I have multi-thrad application and many users use the same object. But only one users has an access for writing. Similiar code: ...
-4
votes
0answers
54 views

Impact on changing UTF 8 to UTF 16 in a java web application [on hold]

Will changing of encoding from UTF8 to UTF 16 in a java web app create a hole in its security ? Note: App uses Spring Security Saml Suite for SSO
0
votes
1answer
51 views

JSP without .jsp-files?

I have a little project (a CMS) that was developed using .jsp-files in 2006. I moved in 2011 to JSF and had only one .jsp-file for the frontend. In 2014 I integrated the backend into the frontend ...
0
votes
0answers
19 views

Using a mock Spring bean

I m actually introducting to unit testing with Junit and I am wondering if I m doing the things right. In fact, I want to test a service in which I inject a repository (a Spring bean in my case with ...
-3
votes
0answers
17 views

JSP Web app to chrome app [on hold]

i have a jsp web app with single function like kiosk app just single user at a time but now i want to make it or move it like a chrome full screen app. JSP app run on apache tomcat server locally
-1
votes
1answer
132 views

What's the returning a value in Java?

public void warning(){ System.out.println("Watch out!"); } public void warning(){ System.out.println("Watch out!"); return; } We must use "return" statement with void methods. Bot ...
16
votes
7answers
1k views

What is the value of workflow tools?

I'm new to Workflow developement, and I don't think I'm really getting the "big picture". Or perhaps to put it differently, these tools don't currently "click" in my head. So it seems that companies ...
-6
votes
0answers
27 views

Beginner's Java - Help Needed Using Eclipse! [migrated]

I have been busting my brain for days trying to complete this Java project and for the life of me I cannot get it to run. Here is what I am supposed to do: Write a program that calls each of the ...
1
vote
1answer
233 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){ ...
-5
votes
0answers
42 views

Things which Java develops should know about php? [on hold]

I am a java developer starting out to write code in php. Would be great if there are some similar best practices between them?Just to get started in php if there are equivalent stuff for the ...
0
votes
1answer
52 views

Reflection performance in this iteration of a (probably) large excel file

I'm wondering the performance of reflection in this situation. I'm iterating a (probably) large excel file (let's say 3000 max) which it's going to be done from time to time, and the implementation ...
1
vote
2answers
193 views

When should we work on GC optimization?

So, I've learnt about how GC works and how can I monitor it via VisualVM, but my question is about why we should ever perform GC optimization? In our web project (JSF/Spring/Hibernate) we haven't ...
-3
votes
0answers
30 views

Which Rule engine should be used in a Java environment? [on hold]

Im looking to create/use a rule engine. The problem is to choose which one needs to be used. Drools seems to be the most comprehensive rule engine in the market. The requirements and the rules and ...
0
votes
1answer
143 views

Shortest path to visit all nodes [duplicate]

I am given a set of tourist attractions(nodes identified by x, y) and i need to find the shortest path to visit them. The way i thought of it, is i will ignore if there are streets available and ...
0
votes
2answers
34 views

Which 'InputStream' subtype is used by 'Socket' type object here?

In the below server socket program, byte stream object is used to read data from client, as mentioned - InputStream in = socket.getInputStream(); public class SingleThreadTCPServer{ ...
0
votes
2answers
178 views

What design pattern for changing interface?

Sorry guys, I should have clarified the fact that the modified method is abstract in Father. Then if the method signature changes, all its implementations in SonX shall also change(at least the ...
-3
votes
0answers
88 views

Why does Java apply the concept of value pooling only to Strings?

Why are Strings the only type to benefit from pooling in Java? There are many data types the concept could be applied to. What makes the String type different from int, char, etc?
1
vote
1answer
40 views

Query on java I/O BufferedOutputStream write() method

Below is the code that is written using byte stream non-buffer class FileInputStream and FileOutputStream with the usage of explicit user buffers. public class FileCopyUserBuffer{ public static ...
-9
votes
0answers
37 views

Hello everyone pl solve my query [on hold]

hii its a little query for me as i was looking for a career in the java but didn't get the same.How could be the field of android developer, is it equivalent to java ...
3
votes
1answer
42 views

Template pattern with varying input type in overridden method

I am trying to use template pattern to define a generic algorithm in java. But the method that needs to be overridden, takes an object as input. This object will vary depending on the concrete ...
0
votes
4answers
684 views

Why 'List<E>' is an 'interface' but not 'abstract class'?

While defining the hierarchy, one can think to embed the abstract method(behaviour) in abstract class only because the derive concrete class posses that as core behaviour with it's specific ...
0
votes
1answer
117 views

Whats the difference between byte and Byte? [duplicate]

Alright so of course, I know the differences. byte is a primitive and Byte is an object. Byte offers more functions but there is one thing I dont understand. Why would anyone create a variable using ...
-2
votes
0answers
75 views

Is it worth it to learn Swing? [closed]

I'm a computer science student (2nd year), and in my university, they teach us java but they do not teach us how to make GUI's wich Java. Here, they say that Java Swing is slow and useless to learn. ...
-7
votes
0answers
18 views

Simple Reversi realization in Java [on hold]

Where can I get simple Reversi board game realization in Java for educational purpose? I found only very hard implementations. That is not good.
1
vote
1answer
149 views

Why is close() implemented in InputStream/OutputStream?

It make sense to see close() as non-core functionality of stream objects. This is the reason this method is placed in interface Closeable. One evidence is that class ByteArrayInputStream does not ...
0
votes
1answer
422 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 ...
1
vote
2answers
60 views

Query on hiding implementation details in java

With the below piece of thread related code, I see that author of Thread class is hiding the details about the working of start() method. What a user of Thread class need to know is, class Thread ...
-1
votes
1answer
69 views

Thinking in Java 4th edition - How to read efficiently? [closed]

a) Is there anyone who could give me some tips how to read Bruce Eckel's book efficiently? So far I read 230 pages of Eckel's book in 19 days (i made all the exercises, coded alot) - i went trough ...
0
votes
0answers
20 views

vert.x message bus architecture

A large part of the vert.x architecture is around the message bus, and message passing between verticals. The main idea I guess being that I can create multiple modules (possibly in multiple ...
-1
votes
2answers
73 views

Initialize in Field, Constructor, or Argument

If I know what a field will be initialized to, should I initialize it in the field, constructor, or receive it as a parameter? For example, where should I initialize an ArrayList? Initialized in ...