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

7
votes
2answers
589 views

When will java change to 64bit addressing and how can we get there faster? [closed]

Having to work with large files now, I would like to know when the java libraries will start switching to long for indexing in their methods. From Inputstreams read(byte[] b, int off, int len) - ...
1
vote
0answers
77 views

Should I assert in packages?

I have read a few asserts vs exception questions already; I ask specifically about package visible classes though. When you write a package, the classes marked with "public" are exposed to the ...
3
votes
2answers
423 views

Is Java easy decompilation a factor worth considering

We are considering the programming language for a desktop application with extended GUI use (tables, windows) and heavy database use. We considered Java for use however the fact that it can be ...
0
votes
3answers
145 views

Better creating a class with static methods or a object? [closed]

I have a class,, and it has 2 methods. I will use those methods just once , but i would like to know (in term of memory )would it be better to create a object(just once) and use the methods or make ...
1
vote
3answers
96 views

Empty superclass for Collection of derived classes

Basically, what I would like to obtain is a way to iterate through ONE list, and call methods specific to the interface the objects in the collection implement. In my Java project, it would result in ...
0
votes
0answers
138 views

Is this the most efficient way to write this method? [migrated]

Newbie here, I'm writing a method that will compare two objects that store time. I wrote this: public boolean isBefore(TimeType secondTime) { if (_hour < secondTime._hour) { ...
-3
votes
0answers
18 views

JSP page - In a table <TD><input type = text name = “code”></TD> [migrated]

I have created a JSP page with a table containing two columns Code and Description ,the table data is input type="text" name ="code", the functionality which i have to implement is,if i type the ...
8
votes
6answers
966 views

Does anyone work in / know much about programming jobs for scientific / medical research? [closed]

Sometimes I get a bit disillusioned with the types of projects that I work on as they are just basically business apps that aren't exactly groundbreaking and are usually redundant as far as other ...
1
vote
3answers
229 views

Linked list clarification

This is a pretty simple question but I'm new to java. The linked list found in java.util.LinkedList. I saw elsewhere that Java does not use pointers... When I create a new list and add new elements ...
5
votes
1answer
265 views

Should I use JavaFx properties?

I'm usually very careful to keep my Model, View, and Controller code separate. The thing is JavaFx properties are so convenient to bind them all together. The issue is that it makes my entire code ...
1
vote
0answers
99 views

What are the practical applications of nashorn [closed]

Oracle is putting a lot of effort into supporting Javascript on JVM. Rhino was quite capable as a JS engine, yet Oracle saw the need to create Nashorn and optimize it extensively to match V8's ...
-1
votes
1answer
63 views

Should I label class diagram variables as private or public?

In my program, I have several class variables whose access specifier is known as private package. The default accessor specifier in Java is known as private package where it is accessible within the ...
0
votes
1answer
149 views

My UML class diagram is too complicated, what should I do?

Classes have 10-20 links with one another and you can't see anything in that mess of a diagram Unfortunately we finished coding already and if we change the class diagram we have to redo the whole ...
1
vote
2answers
154 views

What's the difference of an object being final and an object being immutable in java?

final String str = "do not change me"; str = "why not?"; //it will result in compile time error saying that final fields can not be re-assigned once created i.e. the reference cannot be changed ...
0
votes
1answer
115 views

Generics list without generics

I am using a very primitive Java that doesn't have Generics, and also I can't use reflection. I want to create a generic list so it would be typed safe (i.e. I only have a list that contains Objects ...
7
votes
3answers
1k views

Multiple Same Object Instantiation

What exactly happens in Java when you instantiate the same object multiple times? For example: Test test = new Test(); then later on I will call it again, Test test = new Test(); again or inside a ...
4
votes
1answer
152 views

Why is Java 7's new file API usage still so scarce? [closed]

I don't even know whether this is the correct StackExchange site to ask such a question but here it is... I principally lurk on StackOverflow; and I am frankly flabbergasted by the number of ...
0
votes
0answers
53 views

Rich console UI

There are bunch of console programs and especially games using full redraw (not sure ho this correctly named) of console window. For example, look at output of linux top program -> ...
36
votes
2answers
17k views

When not to use Google Web Toolkit? [closed]

I'm considering use of GWT on a major in-house web app development project, namely it's major advantage in my eyes is the cross-compilation to Javascript which would (at least theoretically) help my ...
0
votes
1answer
98 views

MVC: How to Implement Linked Views?

I'm developing a java application to visualize time series. I need (at least) three linked views, meaning that interaction with one of them updates the others. The views are: A list represents the ...
0
votes
1answer
133 views

Email Content creation | Proper design

Working on an E commerce application where we need to send so many email to customer like Registration email Forget Password Order placed There are many other emails that can be sent, I already ...
0
votes
1answer
74 views

Can a Java interface declaration enforce parameter properties?

As far as I know, declaring an interface is like so: public interface Roots_Squares { public double square_root( double value ); } Now... how do you enforce value to have non-negative values? ...
1
vote
1answer
144 views

Java code quality in methods calling methods

I am currently working with an "interesting" code-base and see the following type of thing alot in the code. public Object doSomething() { Object obj = new Object(); // Do some stuff to the ...
0
votes
0answers
56 views

Finding plateau in Java Array [migrated]

I having a really hard time finding a plateau within an array. What I'm looking for is length and location of the longest sequence of equal values where the numbers on both sides are smaller. Now I ...
0
votes
0answers
7 views

running javascript in java (compiler verion 1.4) [migrated]

quick question - 30 minutes of google yielded no good results. I am trying to run a .js file from my java application and i understand I can use the library javax.script. However, although there ...
0
votes
0answers
43 views

How to manage data flow between UI components?

I have been trying to use classes that implement ActionListener to respond to user input. I'm consistently noticing that for an action listener to communicate the event to other objects, it has to ...
7
votes
7answers
1k views

Object-Oriented Class Design

I was wondering about good object oriented class design. In particular, I have a hard time deciding between these options: static vs instance method method with no parameters or return value vs ...
1
vote
1answer
272 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 ...
7
votes
1answer
197 views

Why text editors are recommended over IDEs for beginners in books like Head First Java? [closed]

I am a programmer with some experience in C++ and I am learning Java. In most of the Java books (like Head First Java) authors ask readers to stay away from IDEs and recommend using a good text ...
2
votes
3answers
209 views

how and should I 'unit test' an entire package?

I'm still learning to be good about doing unit level testing, as I've always been a little sloppy about only doing functional testing in the past, so I want to double check I'm doing this 'right'. I ...
-3
votes
0answers
232 views

Detecting when flow of control has shifted to native thread in java

For an arbitrary Java program for which I have full access to the source code but I cannot re-write per se, (instrumentation is permitted) how can I tell when a java thread has called into a native ...
4
votes
4answers
640 views

Make methods that do not depend on instance fields, static?

Recently I started programming in Groovy for a integration testing framework, for a Java project. I use Intellij IDEA with Groovy plug-in and I am surprised to see as a warning for all the methods ...
1
vote
1answer
402 views

Is there any benchmark comparing diffentent Lucene implementations? [closed]

Lucene is 100% java. Also, it has been implemented in different languages. I think that java, being an interpreted language, is slow, so processing expensive requirements like indexing cannot be a ...
-2
votes
0answers
94 views

Is there any other way to run .exe from Java? [migrated]

The main problem is that I cannot run my c++ logic by running it through Java; am I creating a subprocess properly? Thank you all; --- UPDATE! --- So I have written these to test the ability to open ...
0
votes
2answers
251 views

What graph traversal algorithm should I use?

I would like to write an algorithm which can traverse a graph and hopefully later I can implement it to use for an indoor navigation system. The graph would come from floor plans of a building and ...
5
votes
3answers
2k views

Using NetBeans and Eclipse together [closed]

I'm working on a collaborative group project at university which involves writing a Swing application, an Android application and some Java data models and a JDBC connection. We've been taught to use ...
2
votes
1answer
143 views

MVC design, singleton in model with initialization

I've recently learned of MVC (model view controller) and am trying to refactor an existing program. I am in a situation where I'd like to have exactly one object of a particular class so it seemed ...
0
votes
0answers
66 views

Algorithm / working approach to get a random list of data

I am working on a android schedule app but that isn't matter , the problem is a algorithm / methodology so you are welcome to just write the pusedo code to answer. The data is like this Place ...
0
votes
1answer
418 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. ...
23
votes
7answers
10k views

Why not Spring framework?

Are there any disadvantages in tying my application to Spring framework? I'm not talking about bugs or issues like that, if any. I'm talking about strategic, architectural things that will influence ...
0
votes
1answer
112 views

Familiarize with unknown source code [duplicate]

I have to continue feature development, issue fixing of a halfway completed code base. There is a no documentation, all developers had left the company. The technology stack is somewhat familiar to ...
0
votes
0answers
234 views

Make a java program use more processors

I am running a program that is supposed to solve a problem with the brute force approach. My computer has a quad-core CPU. When I run the program clearly java uses only one core, because in my ...
4
votes
3answers
460 views

Java's Boolean class - why not an enum?

It seems to me that the Boolean class is an ideal candidate to be implemented as an enum. Looking at the source code, most of the class is static methods which could be moved unchanged to an enum, ...
0
votes
1answer
168 views

Is it fine to skip MVC?

I am building a pair of components that communicates in a one-way fashion: [ JButton ] --> data...process...process...out --> [ JTextField ] The JButton allows the user to select a file and ...
0
votes
1answer
128 views

Passing data between classes

A question similar to this has been asked before, and will be asked again I am sure. I have spent some time googling and trying to work this out for myself, but I am at an impasse. What I am trying ...
0
votes
1answer
90 views

Where to put variables needed across classes?

I have 3 classes: a JButton extension, FButton; a JTextField; and a JPanel extension, FPanel, that would contain one instance of both. The FButton is supposed to open a file, and make the file name ...
16
votes
1answer
513 views

Workaround for Java checked exceptions

I appreciate a lot the new Java 8 features about lambdas and default methods interfaces. Yet, I still get bored with checked exceptions. For instance, if I just want to list all the visible fields of ...
1
vote
2answers
2k views

How to execute a Ruby file in Java, capable of calling functions from the Java program and receiving primitive-type results?

I do not fully understand what am I asking (lol!), well, in the sense of if it is even possible, that is. If it isn't, sorry. Suppose I have a Java program. It has a Main and a JavaCalculator class. ...
1
vote
3answers
82 views

Entities optional relations: separate classes or single class?

Lets focus on a domain object that is related to more other (different!) entities. Sometimes we need one relation and sometimes the other. Let's be agile and say: we don't know in a front how many ...
24
votes
5answers
3k views

Why is it bad to write something in language X as if you're writing a program in language Y in terms of using a shared coding paradigm [closed]

A while ago, I asked a question on SO about something written in C++, but instead of getting an answer to the problem at hand, the comments went all crazy on my coding style, even when I indicated ...