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

Mixed licenses inside product

This question relates to software-licensing. Someone familiar with open-source licensing may be able to answer this question. I am facing an issue in trying to interpret/understand some Licenses, due ...
-1
votes
2answers
685 views

Importance of data structures in modern S/W development [closed]

During 1990s when there were no advanced frameworks/paradigms available for S/W development , knowledge on data structures was critical... which I can comprehend. But nowadays, for most of the ...
3
votes
2answers
731 views

Which of these two shuffle algorithms is more random?

Which of below two shuffle algorithms (shuffle1 and shuffle2) is more random? public final class Shuffle { private static Random random; public static void shuffle1(final Object[] array) { ...
3
votes
2answers
1k views

What are the different meanings of 'fixture'?

I have some difficulty understanding the concept of "fixture". I know what a test suite is, a test case, a test run, but what exactly is a "fixture"? A parameterized test case? It seems to me that ...
1
vote
4answers
565 views

How to get Object Oriented Programming Concepts? [closed]

What is the best way or best resources or tutorials to learn Object Oriented Programming? For instance, when I begin a program with Java and all my code goes into just one class and I can't estimate ...
0
votes
0answers
100 views

Design decision for implementing the cache re-arrange logic

I'm working on a webapp which has an existing framework to cache values from the database. I have a requirement which needs multiple values from the database and the values have to be ...
1
vote
1answer
249 views

how to model a connection to a resource, with rudimentary event processing

For my simple MUD client I'm using Apache Telnet (no, not ssh). A mud client is a strange beast: Generally, a MUD client is a very basic telnet client that lacks VT100 terminal emulation and the ...
1
vote
2answers
707 views

What is the story behind Java Vulnerabilities?

I always appreciated the Java language. It is known as a very secure platform and many banks use it in their web applications. I wanted to build a project for my school and I discussed the options ...
0
votes
2answers
416 views

Why is this syntax convention?

It says in the book (APress Ganesh / Sharma) about Java 7: You create a method named fill() in the Utilities class with this declaration: public static <T> void fill(List<T> list, T ...
5
votes
2answers
3k views

Excessive use “this” keyword in Java [duplicate]

The this keyword is primarily used in three situations. The first and most common is in setter methods to disambiguate variable references. The second is when there is a need to pass the current ...
2
votes
1answer
557 views

How to audit an Android application (not rooted) without having access to its source?

How can I check if an Android application running on a not rooted device is "secure" without knowing its source? I would look for: Plain text in Web-Requests (wireshark and emulator) SQL-injection ...
1
vote
2answers
361 views

How to deal with system “static” data in java

I was just wondering if there is some better way how to handle system "static" configuration data. Let say you have a system which offers several operation which are in code translated to operation ...
3
votes
1answer
278 views

Mutual observer pattern in Java

I want to improve my multi-threading and design pattern skills. As such I'm designing an Instant Messaging server. I'm writing the Server first. My plan so far is to have Client "Proxy" Classes to ...
23
votes
8answers
24k views

Why can static methods only use static data?

I don't understand why a static method can't use non-static data. Can anybody explain what the problems are and why we can't do it?
4
votes
2answers
1k views

How does MVC work with the principle “Tell, Don't ask”?

Procedural code gets information then makes decisions. Object-oriented code tells objects to do things. — Alec Sharp So, when a view wants to display some information that is suppose to be ...
17
votes
2answers
849 views

Why does Java not put the filename in args?

In C and C++, the main method holds the filename in the first position of the array at argv[0]. In Java, however, the filename is not included in the args string array. Is there a practical reason ...
2
votes
1answer
222 views

Main method templating

Now that I've gotten into a dependency injection groove, I find main methods for different applications all look basically the same. This is similar to stuff you might find on the Guice documentation, ...
0
votes
2answers
701 views

Languages implemented in Python?

AFAIK, Scala and Clojure are implemented in Java and Java is implemented in C. I suppose that many or most languages are implemented in C, for instance Perl, Python and SQL. I don't know much about ...
4
votes
2answers
286 views

May non-GPL-compatible scripts be linked at runtime to a GPLv3 library, by that (GPL) library itself?

First of all, pardon the title, as it's not very clear. I have an application I am writing that is GPLv3, and is in Java, which means that classfiles are generated and linked to for general operation. ...
0
votes
2answers
587 views

Does Java have a built in method to determine if an identifier is legal

Naming a variable or class, for example, must adhere to certain rules (such as not allowing keywords or reserved words as identifiers) I really don't want to code my own method to do such a thing. ...
5
votes
2answers
1k views

Should I use mMember and sStatic naming convention in Android?

Android source code and many Android open-source apps and libs use m prefix for member fields and s prefix for static member fields: private static boolean sStarted; private long mTimestamp; I ...
3
votes
2answers
736 views

How to simulate inner join on very large files in java (without running out of memory)

I am trying to simulate SQL joins using java and very large text files (INNER, RIGHT OUTER and LEFT OUTER). The files have already been sorted using an external sort routine. The issue I have is I am ...
5
votes
4answers
862 views

Performance related doubt in Java with Hibernate

Suppose in some ORM based project (say Hibernate) I am trying to fetch only few columns rather then the whole Object with may be more than 20 attributes. I am writing HQL like "select attr1, attr2 ...
0
votes
0answers
37 views

Program design with multiple data sets, algorithms and results [duplicate]

I have a question regarding the design of my software. The question has already been posted by me at ...
0
votes
3answers
312 views

Liskov substitution principle when implementing two unrelated interfaces

Suppose I have two unrelated interfaces with the same method: interface Table { /** * @param width (0 < width <= 100) */ void setWidth(int width); } interface Square { ...
1
vote
3answers
352 views

Program design with multiple data sets, algorithms and results

I have a question regarding the design of my software. There are four different data sets and three consecutive algorithms operating on the data sets and on the results from the previous algorithm ...
9
votes
5answers
3k views

Is try-finally expensive

In case of code where you have to do a resource cleanup before exiting a function, is there a major performance difference between these 2 ways of doing it. Cleaning the resource before every return ...
2
votes
1answer
376 views

Why would one transform a checked exception to an unchecked exception? [duplicate]

My buddy told me today that some programmers transform a checked exception (e.g. EJBException, SQLException...) to an unchecked (RuntimeException?) My buddy explained a call stack where if you change ...
0
votes
1answer
223 views

What is the one or the few major changes from Java 6 to Java 7, couldn't JBoss do that already with Java 5? [duplicate]

A buddy said today that one change between v6 and v7 is that v7 will close for instance database connection "automatically" but couldn't JBoss do that already with Java 5? I've seen "JBoss is closing ...
3
votes
2answers
433 views

What if my nested class extends another class from another package?

I'm in doubts this design is OK, it may be there is a way to do it better? The case is that I need a class which would be used in one and only class and that's it. But, this class needs to inherit ...
2
votes
2answers
4k views

Is rewriting some Java code to C++ using JNI to improve performance a good idea? [closed]

I've tried rewriting some Java functions in C++ and called them using JNI. I observed that it takes longer time to execute the native C++ functions as compared to Java functions, due to the JNI ...
21
votes
4answers
2k views

How many days is it normal for a new hire programmer to take to get up to speed? [duplicate]

I have just landed a role as a C#/Asp.Net developer at a large software house. I have previously worked at a much smaller software house for about two years but it was a varied/mixed role there, and ...
2
votes
1answer
787 views

Subtractive color mixing algorithm

Here is my problem: I have a set of 'n' colors including the primary colors and their codes in hexadecimal. Now given another color 'x' I wonder if it's actually possible to come up with a mix ...
0
votes
1answer
237 views

Will having ClassA extend ClassB slow down my runtime performance compared to having classC which contains all the members of ClassC?

I have a class with a lot of methods. I would like to group similar methods together in their own class, but all of the methods need to extend another class, ClassC. So I was thinking of having ...
3
votes
1answer
2k views

How to create own programming language based on JVM? [closed]

I am curious about how to create a programming language based on JVM so I have tried to get some info online, but the information I got are quite fragmented. What I found are mostly information ...
1
vote
2answers
422 views

Access JSON object in different Languages

I have a Java code which is writing some data in string format to Messaging queue. Now any one can subscribe to this queue and fetch this data. Here the client fetching this data can be written in any ...
-3
votes
1answer
216 views

Java Program That Notifies When Camera is Being Accessed

I'm trying to find a developer to write me a pretty basic program. I am also a developer, but don't have enough time to write it myself. This program has a pretty basic function. It will notify ...
13
votes
9answers
7k views

Are too many if-else statements for validation bad? [duplicate]

From the book Professional Enterprise .Net, which has 5 star rating on Amazon that I am doubting after having a read through. Here is a Borrower class (In C# but it's pretty basic; anyone can ...
1
vote
2answers
302 views

Java exception redundancy

To what extent should one make exceptions redundant or atomic to a method. For instance, suppose I have a method public void authenticate(String username, String password) that calls private void ...
0
votes
1answer
254 views

How best to look up objects by label?

I am writing the server backed by a pre-written API. I'm going to get a number of strings representing ports, signals, paths, etc etc etc. I need to look up the object associated with a given label, ...
1
vote
1answer
175 views

How/Where do I give my github commit a version?

I 'm just learning to give project versions. I understand writing details about the changes in my project when committing, but where should I put my version number for my project?
-1
votes
1answer
2k views

web spider for facebook

I just subscribed to a facebook page which post links to different open source projects or code archives. I'll like to save those links and descriptions to a local db. How can I do that? I heard ...
2
votes
3answers
307 views

What is the difference between state and field? [closed]

Is state another name for field or is it something different? For example: private int telNumber; can I say about telNumber that it is a state or it is a field?
1
vote
2answers
2k views

What is the size of a reference variable in java. Can it be calculated?

As pointers in C require 2 bytes of memory size irrespective of the size of the data type they are pointing. So does the same thing applies to java references also ?
0
votes
1answer
198 views

Method visibility for testing partial mocks

I'm currently writing unit tests to test behavior of a method and would like to partially mock the methods calling injected properties. For example: public void doSomething() { int complicatedInt ...
0
votes
1answer
2k views

Is Java still king of cross-platform compatibility? Is the answer still Swing? [closed]

So basically, my company is looking to create an app that can be distributed on Linux, Mac OS X, and Windows. We are hoping for a cross platform solution. I have experience working with Java Swing ...
1
vote
2answers
665 views

Without C++-like destructors, how do we return resources that aren't managed by garbage collector in Java? [duplicate]

I'm in a job hunting. And in my CV I placed a skill list like: Skills: C/C++/Java/... The most common question I got is: "hem, since you are familiar with both C++ and Java, can you tell some ...
1
vote
1answer
2k views

What is bootstrap listener in the context of Spring framework?

I am studying Spring framework, in web.xml I added following which is a bootstrap listener. Can anyone give me a proper idea of what is a bootstrap listener? <listener> ...
23
votes
2answers
3k views

Is it *ever* okay to catch StackOverflowError in Java?

I used to think that it's not, but yesterday I had to do it. It's an application that uses Akka (an actor system implementation for the JVM) to process asynchronous jobs. One of the actors performs ...
-1
votes
2answers
7k views

How to update an existing excel file using java program? [closed]

I've made a file browser in java that opens and read already been made excel files. (using Apache poi 3.9 library) program read those files perfectly but i want to update some of those files. how can ...