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
vote
0answers
14 views

Is it possible to build up a “stack trace” from the code (using some tool) in Java

To analyse workflows in a bigger environment I usually spend a fair amount of time walking through code by using "go to implementation" or "find usages" lookups. But after 4 or 5 jumps its sometimes ...
0
votes
0answers
6 views

register action working very fine but there is a problem in login that it couldn't find its corresponding result

LoginAction--- package actions; import java.util.Date; import java.util.Map; import com.opensymphony.xwork2.Action; import com.opensymphony.xwork2.ActionContext; import dao.UserDao; public ...
-3
votes
0answers
18 views

i am trying to print age, height and name using the concept of multiple constructor is java but something is wrong. can anyone help me please?

// this is my timePractice class package timepractice; public class TimePractice { public static void main(String[] args) { timeRegular obj = new timeRegular(); obj.setAge(20); ...
0
votes
1answer
39 views

Immutable class with behavior

I've just finished Effective Java and I loved it. I'm trying to refactor one of my programs to take advantage of what I've learned, and I have a lot of questions regarding immutability. My program is ...
1
vote
1answer
33 views

Is it appropriate to pass in a derivative to calculate the error of a Neural Net?

I'm reading a guide for back-propagation of a neural net, and it gives the error function as: Next work out the error for neuron B. The error is What you want – What you actually get, in other ...
0
votes
0answers
30 views

Better Approach for retrieving multiple RESTful calls

I have an Android application that associates bluetooth beacons with data that is retrieved from a server via RESTful calls. Once the app is launched, we have a page with a table that is being filled ...
1
vote
0answers
37 views

Separate GUI for clients

I am writing a game in which I have a Java server/client system set up. Everything is working great, but I reached a slight problem. I have set up a basic health system, and a GUI to go with it (for ...
-1
votes
1answer
96 views

Carriage return not working properly in eclipse [on hold]

Carriage return is not working when i execute the program it produces the n number of characters after "\r" in a newline class NewClass{ public static void main(String args[]){ String str = "Hey ...
2
votes
2answers
73 views

When should I instantiate a variable rather than grabbing it through a method?

This may be tedious, but I would love to know which is a more efficient way of programming. The result may only be slightly better or slightly worse, but I am still interested in which is 'better'. ...
1
vote
0answers
57 views

The same objects are staying in memory across multiple executions

I was testing a neural net I created, and noticed something odd. The net uses a hashed adjacency list (roughly) to maintain its links. The vertices of the list are the nodes of the net. I chose to ...
6
votes
9answers
1k views

How to teach computer science? [closed]

I am just starting to teach computer science. It's just the basic level. I'm finding that I sometimes don't know how to approach topics in a way that lets students easily understand. I've found that ...
23
votes
17answers
6k views

What are some good assignments for an introductory course, to reach today's students? [closed]

I periodically teach an introduction to programming course using Java. I want to give my students some exciting assignments that they can relate to or find interesting. At the very least, I want ...
-4
votes
0answers
35 views

Difference between == and .equals (java) [on hold]

I store my game map as Tile tiles[][] array For singleplayer game in render fuction I can use if (map.data[x][y].group =="crappyblocks") {do ......} Group is a string. I started making basic ...
3
votes
2answers
199 views

Is it worth it to use a message-queue framework in this case?

We have these things called "executions" that are run at certain times. They have a delay property that basically says "execute me after delay microseconds`. Currently we are using Cassandra as a ...
4
votes
1answer
102 views

Why does Java define BigInteger / BigDecimal values of 10?

Question perhaps slightly left of field - but I'm curious as to the logic behind why Java's BigInteger/BigDecimal classes feel the need to define a constant of TEN? Example taken from ...
13
votes
10answers
1k views

Does low latency code sometimes have to be “ugly”?

(This is mainly aimed at those who have specific knowledge of low latency systems, to avoid people just answering with unsubstantiated opinions). Do you feel there is a trade-off between writing ...
0
votes
4answers
130 views

Handling DomainExceptions using REST endpoint

Suppose I'm doing some DDD. Now, I have a microservice reflecting a bounded context/a part of a bounded context. Now, suppose there is a REST endpoint: '/somedomainmodel/someaction' My API user is ...
6
votes
1answer
74 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 ...
1
vote
2answers
100 views

Could changing the return type from void to string introduce breaking changes?

This SDK have an interface like this: public interface Contract { void update(..); void action(..); void delete(..); } Now, we need to change it to something like this: public ...
-4
votes
1answer
76 views

Questions about a java developer job > semiconductor industry [on hold]

I am an experienced java ee developer and I got this job offer: A java developer for a company that produces software solutions for the semiconductor industry. I've got two questions: 1- ".. ...
-6
votes
0answers
43 views

I need a program of factorial and then this [on hold]

Make a program that outputs a factorial of any number and then compute its running time and prove that that running time is an element of theta n^2
1
vote
1answer
5k views

Java desktop application using MVC + Hibernate

I'm developing a Java desktop application. I'm planning to use MVC architecture described at Oracle site: Java SE Application Design With MVC. I need to store data in database so I decide to use ...
0
votes
2answers
132 views

Design Patterns: What design pattern should I use for the following? [duplicate]

I am trying to write an utility which traverses through a list of files and searches for a string in each file. On finding the string in a file, I will add it to a list and display the list. Which ...
27
votes
6answers
4k 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 ...
0
votes
3answers
88 views

Implementing a Generic List in Java

In an effort to understand Generics in Java (and how to use them), I am trying to implement a list structure using them but have hit a wall. Scenario: Suppose there is some classes (we'll call them ...
-3
votes
0answers
25 views

What is the dereferenced in switch block? [on hold]

I executed the following code and I got the following errors. RunUnitConvert.java import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import ...
0
votes
0answers
30 views

How should I go about making a statistics analyser? [on hold]

I'm making a program which should analyse the stats of all soccer premier league players in fantasy football (form, price, fixtures, injuries etc) and using those stats, predict point potential/value ...
15
votes
6answers
1k views

Why does the TRACE level exists, and when should I use it rather than DEBUG?

In Log4J, Slf4J and a couple other logging frameworks in Java, you have two "developper" level for logging. DEBUG TRACE I understand what DEBUG do, because the explanation is clear. The ...
2
votes
1answer
124 views

Good Coding practice with respect to interface versus class versus super class

I am currently reading the following tutorial and have gotten up through here http://docs.oracle.com/javase/tutorial/java/concepts/interface.html Maybe I should not be thinking about this question ...
-5
votes
0answers
44 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
2answers
323 views

A 'task' system which has an ending, to get ready for next task

I want to make a system, so that there are certain tasks. For example, let's talk about a game. I want to make it so there are 100+ tasks doing different things, but when the player's magic level is ...
1
vote
3answers
177 views

How to use Guice for an effective API Design?

I am creating a base API in JavaSE, which includes modules like MVP architecture, Service & Repository Layer, Event Model to fire events between presenter etc. I am trying to implement all best ...
-4
votes
0answers
35 views

Windows custom lockscreen program [on hold]

I'd like to create a windows application that locks my screen, I want the program to have the same functionality as this program but I want to add functionality to it so I can play custom sounds and ...
0
votes
0answers
77 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
129 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 ...
2
votes
1answer
140 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
49 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
365 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
83 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
51 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
30 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
174 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
132 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
19 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
89 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
44 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
196 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 ...