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

14
votes
6answers
11k views

Is it worth learning either GWT or Vaadin? [closed]

I consider myself a decent java/web developer. In my career I have always used servlets and ejb's with a web front end, most recently incoporating jquery and ajax. I can see the theoretical benefit ...
13
votes
2answers
2k views

What is the ideal learning path to building Android apps with Scala, without prior Java experience

Unfortunately, there are not currently any books on the subject of 'Learn Android Development with Scala', which would be the ideal solution. I'm guessing that I'll need to pick up at least 3 books ...
13
votes
4answers
4k views

Explain Model View Controller

My experience with developing dynamic websites is limited mostly to Java servlets. I've used Tomcat to develop various Java servlets, and I wouldn't hesitate to say that I'm reasonably proficient ...
11
votes
4answers
18k views

REST vs RESTful vs “normal” web service - the same or not?

I've read a couple of definitions and discussion on REST and/or RESTful applications, but I still do not understand the real meaning of it. I usually work with the apps which either fetch data via ...
11
votes
8answers
20k views

Is JSF really ready to deliver high performance web applications? [closed]

I have heard a lot of good about JSF but as far as I know people also had lots of serious complains with this technology in the past, not aware of how much the situation has improved. We are ...
9
votes
4answers
12k views

Java or Python for internet application? [closed]

In choosing a technology for internet applications where the number of users may scale over time, which one should we consider: Java or Python? What are the considerations in choosing one and not the ...
19
votes
3answers
5k views

Why not Green Threads?

Whilst I know questions on this have been covered already (e.g. http://stackoverflow.com/questions/5713142/green-threads-vs-non-green-threads), I don't feel like I've got a satisfactory answer. The ...
9
votes
3answers
5k views

Differences between “Java OOP” and “Pythonic OOP”? [closed]

I started with ActionScript 2.0 and then went on with Java. I have learned, or at least used, a bunch of languages since then, including Python (probably my favorite). I'm afraid that my style of ...
8
votes
3answers
14k views

Is C# more superior than Java as a programming language, objectively speaking? [closed]

A colleague (a .NET fan) argued that (in context to Java vs .NET comparison), while there are different arguments for Java and for .NET, and to determine which one is the better choice is a business ...
4
votes
2answers
1k views

OOP - Composition, Components and Composites Example?

I've been reading a bit about OOP in relation to Composition, Components and Composites. I believe I understand the fundamental principle (not sure). Can someone please provide a code example of a ...
27
votes
4answers
3k views

Why is .compareTo() in an interface while .equals() is in a class in Java?

I want to know why the .compareTo() is in the Comparable interface while a method like .equals is in the Object class. To me, it seems arbitrary why a method like .compareTo() is not in the Object ...
26
votes
5answers
2k views

Is use of finally clause for doing work after return bad style/dangerous?

As part of writing an Iterator, I found myself writing the following piece of code (stripping error handling) public T next() { try { return next; } finally { next = ...
23
votes
2answers
1k views

Should You Log From Library Code?

If I am developing a Java library, is it good practice to issue log statements from within the library's code? Having logging within the library will make debugging and troubleshooting more ...
20
votes
7answers
4k views

Is there a more intelligent way to do this besides a long chain of if statements or switch?

I'm implementing an IRC bot that receives a message and I'm checking that message to determine which functions to call. Is there a more clever way of doing this? It seems like it'd quickly get out of ...
16
votes
3answers
1k views

Does decoupling trump DRY in REST?

I am building a REST API to expose most of functionality of an existing Java API. Both APIs are for internal use within my organization; I do not have to design for external use. I have influence ...
14
votes
1answer
1k views

Considerations on which Java version to run in Production

Some people run the bleeding edge of technologies - updating the day that something is updated. In production, this isn't as appropriate. Researching about if the current (Java 7) version is ready ...
9
votes
9answers
13k views

Best way to handle nulls in Java?

I have some code that is failing because of NullPointerException. A method is being called on the object where the object does not exist. However, this led me to think about the best way to fix ...
8
votes
2answers
10k views

Open source projects, how to choose?

I would like to join an open source project since I think I am good enough at programming to progress onto reading others code and to modify it. But the problem is, how would I choose an open source ...
7
votes
9answers
9k views

Most efficient way to learn java if you already know how to code? [duplicate]

Possible Duplicate: Is there a canonical book for learning Java as an experienced developer? I've been coding for close to 25 years now in basic, (C64 & Amiga), (Object) pascal, C, LPC ...
4
votes
3answers
504 views

What is the best use case for selenium?

I've been trying to develop web applications while at the same time creating the testing. I understand unit testing, I can declare a test method and test specific methods in my application. But I ...
3
votes
2answers
11k views

Java language book for an experienced programmer? [duplicate]

Possible Duplicate: Is there a canonical book for learning Java as an experienced developer? I am looking for book to get up to speed with (start with) a Java language. I am experienced ...
24
votes
6answers
2k views

How is major software protected? [duplicate]

I am a new software developer and I wish to sell my software. I recently realized that from C++ code we can not stop the user seeing parts of the code that are related to scripts or system commands. ...
21
votes
11answers
2k views

Should I use a code repository if I am the only one working on a project? [duplicate]

Possible Duplicate: Version control for independent developers? I am not sure if I should use a code repository when I am the only one working on a project.
17
votes
4answers
1k views

How can I use unit tests and TDD to test an app that relies mostly on database CRUD operations?

At work, one of my projects is mostly about taking data passed in from an external client and persisting it in a database. It's a Java enterprise app using JPA and most of our logic revolves around ...
11
votes
3answers
2k views

How to create better OO code in a relational database driven application where the database is poorly designed

I am writing a Java web application that consists mainly of a bunch of similar pages in which every page has several tables and a filter that applies to those tables. The data on these tables comes ...
10
votes
6answers
819 views

What factors to consider when choosing runtime/language for Windows desktop applications?

My users all have Windows. Some of them use Linux or a Mac, but if they do they're generally capable of using something like Mono, Wine, Parallels or dual-boot. My development team (including myself) ...
9
votes
4answers
1k views

Is there any reason lazy initialization couldn't be built into Java?

Since I'm working on a server with absolutely no non-persisted state for users, every User-related object we have is rolled out on every request. Consequently I often find myself doing lazy ...
8
votes
6answers
875 views

Static functions vs classes

Let's say that I want to build some utility functions to do some basic maths with the BigDecimals, for example I want to have a function that computes the average of a List<BigDecimal>. What is ...
8
votes
3answers
754 views

C++ for Java Programmers [closed]

I am going to have a lecture about C++ for experienced Java programmers. Because C++ is a big language and I have just one lecture, I want to point out the most important "gotchas" and C++ features ...
6
votes
2answers
14k views

Why shouldn't I be using public variables in my Java class? [duplicate]

In school, I've been told many times to stop using public for my variables. I haven't asked why yet. This question: Are Java's public fields just a tragic historical design flaw at this point? ...
2
votes
7answers
1k 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
7answers
1k views

Becoming a better C/Java programmer [closed]

I've currently hit a plateau and want to get better at coding in C and Java. I want to improve, but I think I hit a plateau on my learning curve. I can't find any "advanced" tutorials on the net; most ...
34
votes
6answers
3k views

Good or bad practice to mask Java collections with meaningful class names?

Lately I've been in the habit of "masking" Java collections with human-friendly class names. Some simple examples: // Facade class that makes code more readable and understandable. public class ...
23
votes
9answers
7k views

Is there any reason to use “plain old data” classes?

In legacy code I occasionally see classes that are nothing but wrappers for data. something like: class Bottle { int height; int diameter; Cap capType; getters/setters, maybe a ...
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 ...
13
votes
6answers
518 views

Expected behavior when an request for a collection will have zero items

Let's say you are given the following... List<Thing> theThings = fubar.Things.All(); If there were nothing to return, what would you expect fubar.Things.All() to return? Edit: Thanks for the ...
13
votes
2answers
2k views

What does “GPL with classpath exception” mean in practice?

Oracle seems to license all their Java-related open source code under the GPL with a classpath exception. From what I understand, this seems to allow to combine these libraries with your own code into ...
12
votes
2answers
651 views

Java: why do collections accept a Comparator but not (a hypothetical) Hasher and Equator?

This issue is most apparent when you have different implementations of an interface, and for the purposes of a particular collection you only care about the interface-level view of the objects. For ...
12
votes
6answers
4k views

Are Java's public fields just a tragic historical design flaw at this point? [closed]

It seems to be Java orthodoxy at this point that one should basically never use public fields for object state. (I don't necessarily agree, but that's not relevant to my question.) Given that, would ...
11
votes
3answers
654 views

Introducing a new JVM programming language into an established enterprise environment

Imagine that your current workplace is a Java shop. There is a lot of built-up knowledge about the Java language and there is a comprehensive build and deployment process in place to handle everything ...
10
votes
2answers
6k views

How to debug/change Java code while the program is running?

I just saw a video showing how Notch (of Minecraft fame) is debugging and changing Minecraft while it is running. He pauses the game, changes something in the code and then unpauses the game where the ...
10
votes
4answers
461 views

Is it better idea to call an external command-line application or to internalize that application's logic?

I have a "pipeline" sort of process that is essentially just linking together a bunch of existing tools to automate a workflow. For one of the steps, there is an existing command-line tool that ...
10
votes
5answers
2k views

What are you thoughts on GWT? [closed]

Since I'm learning Java in this period and I just finished with the tutorials I think I'm ready to start contributing to a project (since I know from experience this is the best way to really learn). ...
9
votes
9answers
6k views

Why Java does not allow function definitions to be present outside of the class?

Unlike C++, in Java, we cannot have just function declarations in the class and definitions outside of the class. Why is it so? Is it to emphasize that a single file in Java should contain only one ...
8
votes
10answers
8k views

Can programmer certifications substitute for degree requirements [closed]

I am a Computer Technician without a computer science background and planning to become a Java programmer. My question is, if I pass a Java certification, would that be enough to for me to get a job ...
7
votes
2answers
4k views

Is it a bad habit to (over)use reflection?

Is it a good practice to use reflection if greatly reduces the quantity of boilerplate code? Basically there is a trade-off between performance and maybe readability on one side and ...
7
votes
2answers
3k views

Can Java be considered a managed programming language?

I am curious; can Java be referred to as a managed language? I am mainly thinking about the Microsoft model when it comes to unmanaged versus managed code (say native vc++ to C#). With the ...
7
votes
5answers
2k views

Suggest other people's code to study [closed]

What open source Java code would you suggest for me to study? EDIT: I'm interested in the design, simplicity(?), their programming style, logic. EDIT2: The first thing that came to my mind is ...
5
votes
1answer
1k views

Places where I can do some voluntary software development/programming work?

I asked this question due to my lack of experience which is a major problem for me when applying for a job because all the companies require 2 to 3 years of programming experience. So I am taking ...
5
votes
4answers
798 views

Starting Java Web Services and feeling lost [closed]

After building mainly Java desktop apps and some small GWT services, I'm trying to learn how to build Web Services in Java but I feel overwhelmed by the sheer amount of buzzwords, terms, ...