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

-5
votes
0answers
12 views

Red Hat JBoss Certified Developer exam (EX225) [on hold]

Is there a way to prepare for the Red Hat JBoss Certified Developer exam http://www.redhat.com/en/services/training/ex225-red-hat-jboss-certified-developer-exam without attending the expensive ...
3
votes
2answers
42 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
0answers
27 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? ...
-1
votes
1answer
22 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 ...
0
votes
0answers
24 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 ...
0
votes
1answer
23 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 ...
-4
votes
0answers
56 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;
1
vote
1answer
59 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 ...
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
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 ...
0
votes
1answer
124 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 ...
2
votes
1answer
95 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
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
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 ...
-4
votes
0answers
24 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 ...
-5
votes
0answers
14 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: ...
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 ...
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 ...
-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
-3
votes
0answers
16 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 ...
-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 ...
-5
votes
0answers
41 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 ...
-3
votes
0answers
29 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 ...
-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?
0
votes
2answers
33 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{ ...
-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 ...
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 ...
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 ...
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
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 ...
-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.
-2
votes
0answers
75 views

Is it worth it to learn Swing? [on hold]

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. ...
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 ...
1
vote
2answers
59 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 ...
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
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 ...
-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 ...
-4
votes
0answers
55 views

Where do programmers look for reference/documentation about Java's features/libraries/functions? [closed]

Rookie programmers learning the language usually use a book or online materials.They are introduced to the language's syntax, common used functions for text processing or math operations. Only a small ...
2
votes
2answers
249 views

Unit testing and reality [closed]

I m actually studying Unit testing, reading some articles on the internet and trying to understand how it works exactly, but it's not very clear for me actually. What should I test ? I have seen ...
-4
votes
0answers
33 views

can someone explain me what does a <enum class>.values() functions actually do? [closed]

I used a values() method in an enhanced for loop to traverse all values in my enum class. But what does this method actually do?
-3
votes
0answers
35 views

Java 1.6 on Eclipse: What does ERROR “annotation must be explicitly requested,” mean when creating new classes? [closed]

I've copied code from a YouTube tutorial and for some reason the program terminates but it never renders the window. I've included Eclipse in firewall exceptions on Mac, I'm sure my system currently ...
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 ...
-6
votes
0answers
28 views

Link's massive in webdriver [closed]

I want create script where the 1st step is to open a website and the 4th step is to click on a button. The button I want to take is from massive. I'm getting an exception. Can you help me or give me ...
-2
votes
0answers
52 views

transitioning from C# to Java. [closed]

I have spent the last five years programming in C#/.net and have been transferred to a Java team. What are some of the things I need to watch out for? What are some of the more enjoyable things I ...
-4
votes
0answers
35 views

Any birdview article about Web development with Java? [closed]

I am new to Java Web development. And I am tasked to create a prototype with Java and related technologies in a short time. So I am looking for some birdview article about the Web development ...
2
votes
1answer
123 views

Why use a enum to create the singleton pattern [duplicate]

Why would you use an enum to create a singleton pattern? To what purpose would it serve over a conventional singleton pattern? I have seen the above used. The code uses an enum to create this pattern ...
2
votes
1answer
31 views

Applying initialization-on-demand holder idiom at variable level rather than class

I was looking for the idiomatic way to implement thread-safe lazy initialization for a configuration collection retrieved from the DB inside a Spring bean. I decided to adapt the ...
-3
votes
3answers
73 views

Simple project ideas [closed]

I am looking for simple project ideas to help teach some of my fellow students. I am trying to team them the following: -If / else if / else -For and while loops -Logical AND / OR -creating ...