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

0
votes
1answer
63 views

Java regex patterns - compile time constants or instance members?

Currently, I have a couple of singleton objects where I'm doing matching on regular expressions, and my Patterns are defined like so: class Foobar { private final Pattern firstPattern = ...
0
votes
0answers
11 views

android app unable to connect to the hsqldb server [migrated]

I am trying to connect my android app to the hsql db server. Server runs on computer-1. I can connect to the db server from local machine through java as well as Db-visualizer. I can connect to ...
0
votes
2answers
86 views

Where Are Multiple JUnit Test Methods Typically Placed in Code?

I've just read the Vogella JUnit tutorial and found it very helpful in understanding how to use JUnit. However, I'm a bit confused about what the convention is for placing multiple test methods in ...
4
votes
2answers
158 views

How does the maintenance of OpenJDK work in practice?

Specifically, I would like to understand the difference between Oracle's JDK and OpenJDK in terms of bug fixes and other patches. Which branch gets fixes first and is Oracle in a habit of making ...
-2
votes
2answers
149 views

how to write good programming logic? [duplicate]

recently I got job as a java developer, and now I have assigned project too. I want to know what is a good logic? when I check in the code my team lead is saying that its a good code. But when it ...
-1
votes
1answer
96 views

A good way to learn a language and fully understand its features and classes is to try all methods in the API

I have an idea that to learn a language (i.e. Java)I need to try all methods from language's API; i want to try to use methods from its API. is this a good idea? there are 10 000 methods in Java API. ...
1
vote
1answer
96 views

Java Desktop Application For Network users

I'm developing a desktop application using Java. My application will run in a network environment where multiple users will access the same database through the application. There will be basic CRUD ...
0
votes
2answers
124 views

Using public domain source code from JDK in my application [on hold]

Can I use source code from ThreadPoolExecutor.java taken from JDK 1.7 considering that the following clausule is at the beginning of the ThreadPoolExecutor.java: /* * Written by Doug Lea with ...
0
votes
5answers
454 views

Reverse subarray of an array with O(1)

I have an idea how to implement sub array reverse with O(1), not including precalculation such as reading the input. I will have many reverse operations, and I can't use the trivial solution of O(N). ...
0
votes
0answers
9 views

Java Program help [migrated]

Okay I have a really annoying error. Its coming from my retainAll method. The problem is that I am outputting 1,3,5 in ints at the end, but I need 1,3,5,7,9. Here is the code below for the MySet and ...
-2
votes
0answers
68 views

Social Network ( Help) [on hold]

I am in a great "problem" so to speak , and I need opinions to decide. The problem is to create a social network without knowing the number of users who use it (but if thinking if they were ...
3
votes
6answers
375 views

More elegant way to avoid hard coding the format of a a CSV file?

I know this is trivial issue, but I just feel this can be more elegant. So I need to write/read data files for my program, lets say they are CSV for now. I can implement the format as I see fit, but ...
1
vote
0answers
141 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 ...
17
votes
5answers
1k views

Why can't Java/C# implement RAII?

Question: Why can't Java/C# implement RAII? Clarification: I am aware the garbage collector is not deterministic. So with the current language features it is not possible for an object's Dispose() ...
2
votes
3answers
195 views

Layering Design Pattern in Java clean code style

As a Java developer, I am developing trying to use the clean code rules. But in my team we are facing a concrete problem: We have a business layer offering a service called "createObject", this ...
5
votes
2answers
238 views

Looking for a very subtle unit testing example

In the context of Continuous Integration, I need to teach unit testing to a 20-people audience of programmers. Everything will be all right, but I am still trying to find the perfect unit testing ...
3
votes
2answers
276 views

Is it viable to make a port from a C++ application to Java through LLVM

how viable is it to port a C++ application to Java bytecode using LLVM (I guess LLJVM)? The thing is that we currently have a process written in C++ but a new client has made mandatory to been able ...
4
votes
5answers
258 views

Either I'm not confident I just don't know anything [on hold]

My name is Sael and I'm 14 years old. Since I was 12 and I got my first computer I instantly go interested in making games. So of course like any other I googled it, got discouraged and forgot about ...
-1
votes
0answers
52 views

How do I make a changing line in a command line program in java? [on hold]

I know how to print a line using System.out.println(). But how can I make a input command that automatically goes to the next line (without pressing the enter key) after input? so that the user can ...
-3
votes
0answers
59 views

what happen when JVM creates an object [on hold]

public class JavaApplication3 { public static void main(String[] args) { JavaApplication3 a = new JavaApplication3(); } } I want to know step by step what happen in heap and stack.
1
vote
1answer
121 views

Validating data to nest if or not within try and catch

I am validating data, in this case I want one of three ints. I am asking this question, as it is the fundamental principle I'm interested in. This is a basic example, but I am developing best ...
0
votes
3answers
194 views

When should method overloads be refactored?

When should code that looks like: DoThing(string foo, string bar); DoThing(string foo, string bar, int baz, bool qux); ... DoThing(string foo, string bar, int baz, bool qux, string more, string ...
3
votes
3answers
213 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 ...
0
votes
5answers
272 views

Does it make sense to generate java classes from class diagram?

As we do design & analysis before development, wouldn't be convenient to be able to generate Java classes from a class diagram? This would promote more exhaustive design and better codes, right? ...
-2
votes
0answers
53 views

How to get client machine ip address in custom realm? [closed]

I want to get client machine ip address in my custom Realm when client attempt to login basically here is detail requirement of project User having role 'Admin' can add new users and assign ...
-4
votes
1answer
104 views

What are Exceptions (checked and unchecked) in Java? [closed]

What is the difference between checked and unchecked exceptions in java? Why do we throw using 'throws' exception instead of catching them?
2
votes
1answer
138 views

Double equals (Not equality) during assigning Java [duplicate]

When I tried searching this I would just get things on equality. When I was reading through some documentation for navigation in Android I had come across something I had never seen before. I came ...
1
vote
1answer
97 views

Is there a name for the Builder Pattern where the Builder is implemented via interfaces so certain parameters are required?

So we implemented the builder pattern for most of our domain to help in understandability of what actually being passed to a constructor, and for the normal advantages that a builder gives. The one ...
0
votes
1answer
33 views

RequestContextHolder.currentRequestAttributes() and accessing HTTP Session

Need to access HTTP session for fetching as well storing some information.I am using Spring-MVC for my application and i have 2 options here. User Request/ Session in my Controller method and do my ...
-1
votes
1answer
60 views

How to name a static factory method in the utility class? [closed]

I have an interface MyLongNameInterface with a counterpart utility class MyLongNameInterfaces. What is the best name for a static factory method in the utility class, which creates an instance of ...

15 30 50 per page