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

2
votes
2answers
6k views

How to increase the efficiency of an Immutable Queue in java?

I have been developing an Immutable queue in java, but the version I have developed is supposedly slow and I have been suggested to create a faster version of the same and I have no idea as to how to ...
5
votes
1answer
505 views

Is this an example of recursion?

I am implementing inheritance of something called Contexts. Each Context holds a link to its parent context. If that Context is the root Context, its parent is null. In order to walk up the ...
4
votes
2answers
1k views

Why shouldn't you use JDBC in Java applets?

I've heard people saying usage of JDBC (Java Database Connectivity) isn't recommended in Java applets. All I they say is: 'because of the security reasons'. What 'security reasons' do they mean? What ...
5
votes
2answers
858 views

Asking people to disable Java for security - what's next for developer?

I don't know what best to give as title to this so pardon me if it sounds weird. I saw this question asked on IT Security and another site asking people to disable Java from their system or browser ...
0
votes
1answer
222 views

Which past version of Netbeans IDE that has lightness almost equal or better than Eclipse Indigo?

Currently, I'm a long Eclipse user because my past and current companies always deal with eclipse. Recently I met some example java codes created using netbeans. I downloaded and tried Netbeans 7.x ...
2
votes
2answers
820 views

Thoughts on a custom data structure for a node/chain implementation

I am designing a simple GUI that will allow a user to create a GPX route by clicking repeatedly on a map panel. I am faced with a design dilemma for how to represent the nodes and route. This ...
11
votes
1answer
1k views

Reasons for removal of function types in Java 8

I have been trying to understand why the JDK 8 Lambda Expert Group (EG) decided not to include a new function type into the Java programming language. Going over the mailing list I found a thread ...
2
votes
0answers
389 views

Why does Java's Collections.unmodifiableList return a List interface instead of an UnmodifiableList interface? [duplicate]

Possible Duplicate: Why were Java collections implemented with “optional methods” in the interface? I was looking at the javadoc for Collections and I noticed the ...
10
votes
3answers
390 views

Why is the minimum value of ints, doubles, etc 1 farther from zero than the positive value?

I know it has something to do with 2's complement and adding 1, but I don't really get how you can encode one more number with the same amount of bits when it comes to negative numbers.
9
votes
2answers
1k views

Which k-best shortest-path algorithms should I consider?

I'm solving a graph-search optimization problem. I need to find the k best acyclic shortest-paths through a directed weighted graph. I know there are a number of exact and approximate k-best ...
-1
votes
2answers
1k views

Difference between daemon and child thread?

As per my knowledge daemon thread is a thread that runs in background(low priority thread) and also a child thread runs in the background when the parent thread runs foreground so where does the ...
-2
votes
1answer
398 views

Why notify and wait are not declared in threads?

wait and notify are said to be communication mechanism in threads but then why are they not declared in Thread class and are declared in Object class instead?
15
votes
3answers
1k views

Does the state Pattern violate Liskov Substitution Principle?

This image is taken from Applying Domain-Driven Design and Patterns: With Examples in C# and .NET This is the class diagram for the State Pattern where a SalesOrder can have different states during ...
11
votes
2answers
1k views

How will the new development of Java influence its interoperability with languages like Scala and Clojure?

As far as I understand, both Scala and Clojure have been designed as new languages that depend on the JVM, and easily integrate with Java code, in the sense that they allow to use Java classes ...
24
votes
9answers
6k views

Should the methods of a class call its own getters and setters?

Where I work I see lots of classes that do things like this: public class ClassThatCallsItsOwnGettersAndSetters { private String field; public String getField() { return field; ...
1
vote
1answer
206 views

Why does Java MessageDigest.getInstance() have a String as a parameter?

I presume it's that way so it could be extended with custom algorithms, but wouldn't it be more convenient to apply, let's say, factory method pattern here and avoid the whole NoSuchAlgorithmException ...
30
votes
8answers
11k views

Is it necessary to add the default case while using switch cases?

During a recent code review I was asked to put default cases in all the files wherever switch block is used, even if there is nothing to do in default. That means I have to put the default case and ...
9
votes
8answers
620 views

Past If statements Arrays, loops… Now what?

I gave up on programming a little over a year ago when I kept hitting this wall. I am revisiting the subject because I want to create basic Android application. But I feel that my limited knowledge ...
6
votes
1answer
480 views

Why can't java generics be in arrays?

Why is it that when I try to make an array of ArrayLists: ArrayList<Integer>[] arr=new ArrayList<Integer>[40]; there is an error and java does not allow this? Is there a reason related to ...
5
votes
1answer
271 views

Why aren't there Dimension and Point interfaces?

I mean something along the lines of: public interface Dimensioned { int getWidth(); int getHeight(); } and public interface Positioned { int getX(); int getY(); } There are a ...
8
votes
5answers
573 views

How to understand and debug legacy software? [duplicate]

Possible Duplicate: I’ve inherited 200K lines of spaghetti code — what now? Not long ago my company placed me in a team that deals with some of the most complex bugs that are in production. ...
14
votes
5answers
3k views

Proper workaround for multiple inheritence in Java (Android)

I have a conceptual problem with a proper implementation of code which seems require multiple inheritance, that would not be a problem in many OO languages, but as the project is for Android, there ...
0
votes
6answers
1k views

Visualization of N>2-D array? [closed]

I have an array of dimension 5. But, I can't figure out how to visualize that array? int[][][][][] array = new int[4][4][4][6][2]. Is there a good way to visualize arrays with dimension counts of 3 ...
4
votes
4answers
2k views

Is there a way to display the stack during recursion method?

I'm trying to learn recursion. I copied this bit of code from my book and added the displays to help me trace what the method is doing and when. public static void main(String[] args) { ...
7
votes
4answers
5k views

Using MVC in a Java app

I need to write a cross-platform GUI application to process (in multiple threads) and visualize fairly large quantities of data. Ideally the application should be relatively fast and look good. The ...
2
votes
3answers
165 views

Would using Quercus make my code fall under the GPL?

Quercus is an implementation of PHP written in Java, and released under the GPL. If I use it, does my PHP code fall under the GPL? What about my Java code? Assuming I write new Java code, and new ...
9
votes
4answers
731 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
2answers
4k 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
2answers
603 views

How to plan a client/server app networking architecture to cope with multiple unrelated exchanges of data?

I'm coding a server/client application pair in Java, as I learn about it. I have basic functionality of sending a message to the server and parsing it but in thinking about the big picture of their ...
10
votes
10answers
5k views

Do I have to learn html and javascript to create web applications?

I am an experienced Java programmer, and I want to create a complex web application requiring dynamic pages, drawings, etc (take SO as an example). Do I have to learn javascript/html in order to ...
8
votes
3answers
2k views

Should I implement an interface directly or have the superclass do it?

Is there a difference between public class A extends AbstractB implements C {...} versus... public class A extends AbstractB {...} AbstractB implements C {...} I understand that in both cases, ...
13
votes
2answers
1k views

Advantages and disadvantages of structuring all code via classes and compiling to classes (like Java)

Edit: my language allows for multiple inheritance, unlike Java. I've started designing and developing my own programming language for educational, recreational, and potentially useful purposes. At ...
11
votes
8answers
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 ...
5
votes
3answers
618 views

Why the name 'continue' [closed]

The 'continue' keyword in Java (and probably in many other programming languages) is used to skip further execution of the current iteration. Why was the name 'continue' chosen? Why not something ...
6
votes
2answers
2k views

Matrix Pattern Recognition Algorithm

I am designing a logic analyzer and I would like to implement some Matrix Algorithm. I have several channels each one represented by a row in the matrix and every element in the column would be the ...
5
votes
3answers
1k views

How to create a manager class without global variables nor singletons?

I would like to implement some kind of manager class in my application. It will be in charge of loading textures, processing them, distributing them etc... At first, I wanted to make a global ...
2
votes
8answers
883 views

tips, guidelines, points to remember for rendering professional code? [closed]

I'm talking about giving clients professional looking code. The whole nine yards, everything you hardcore professional highly experienced programmers here probably do when coding freelance or for the ...
2
votes
2answers
349 views

Pattern for loading and handling resources

Many times there is the need to load external resources into the program, may they be graphics, audio samples or text strings. Is there a patten for handling the loading and the handling of such ...
1
vote
3answers
174 views

Which VCS is more applicable for our workflow?

Currently we have code stored on a shared network drive and do not use any kind of VCS. The code stored on our shared network drive is always being backed up. We would like to keep things as close ...
10
votes
3answers
2k views

What are the downsides of implementing a singleton with Java's enum?

Traditionally, a singleton is usually implemented as public class Foo1 { private static final Foo1 INSTANCE = new Foo1(); public static Foo1 getInstance(){ return INSTANCE; } private ...
2
votes
1answer
849 views

Remembering user credentials in standalone Application

I'm developing a standalone application using java, I have a Login screen, wherein user enters his username and password. For each instance of the application, user have to enter his credentials. From ...
2
votes
3answers
2k views

What is meant by 4 GL?

I came across the term 4GL(generation language) in reading about Oracle ADF Busniess components . I want to know what exactly is 4GL ? This is the actual quote from the book Oracle Fusion Guide: ...
3
votes
2answers
773 views

Should the 12-String be in its own class and why?

This question is regarding a homework project in my first Java programming class (online program). The assignment is to create a "stringed instrument" class using (among other things) an array of ...
-1
votes
2answers
706 views

What are the ways to start making actual/real-world programs using Java/C++ to excel my Programming Skills? [duplicate]

Possible Duplicate: How do I improve my coding skills? How I do become a better programmer as a junior developer The programming that we learn at university is not that vast, like those ...
4
votes
6answers
3k views

What are abstract classes and abstract methods?

I got several explanations but so far I'm not able to understand that what are the abstract classes and methods in Java. Some said it has to do something with the security of the program, other said ...
2
votes
1answer
574 views

UML Class diagrams with Java packages?

I am trying to model in UML 2.0 a Java servlet application that has three classes Servlet class; essentially a main class that acts as the controller DatabaseLogic; contains methods for database ...
-3
votes
2answers
482 views

What are the certifications to be need for the Java Architect? [duplicate]

I'm the senior software developer working in a private company. I want to became the Software Architect in the Java side. Could you please tell me the certifications releated to my scenario?
3
votes
1answer
505 views

script engine with no global environment (java)

I am curious about how global variables are handled by script engines. I am looking for a script engine that does not preserve the state of global variables upon invocation. Are there such engines out ...
5
votes
2answers
768 views

How to create contracts in python

I am currently learning Python (from Java) and have a question on contracts. Example: an application defines an interface that all plugins must implement and then the main application can call it. ...
10
votes
2answers
958 views

Why is using C++ libraries so complicated?

First of all, I want to note I love C++ and I'm one of those people who thinks it is easier to code in C++ than Java. Except for one tiny thing: libraries. In Java you can simply add some jar to the ...