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
0answers
37 views

What is Agile environment for Java development mostly used today?

We are working on a new project and want to build up Agile environment for Java development. Our mid-tier is J2EE + Restful + Web service. Frontend is iOS and native API is used to develop iPad. ...
0
votes
0answers
15 views

Filtering data with CriteriaBuilder to compare enum values with literals not working [migrated]

I have a java class with a enum field, org.example.Importacion { ... @Enumerated(EnumType.STRING) private EstadoImportacion estadoImportacion; public static enum EstadoImportacion { ...
-3
votes
0answers
16 views

Why not successful “ HTTP GET request with socket ”? [migrated]

I want to send GET message at my Android application. After I want to receive GET response as 200 OK. But I didn't accomplish. I received 408 Request Time-outDate or nothing. Can you help me? String ...
-4
votes
0answers
27 views

What is stored on the Heap? [duplicate]

When it is said objects are stored on the Heap, which objects does this refer to? In the following example a is stored on the Stack. MyType obj a= new MyType(); a.meth(); So what is stored on the ...
-2
votes
1answer
33 views

ClickHandler for button = strategy pattern? [on hold]

If you provide a implementation of a ClickHandler interface to a button (defining some behaviour), is this the strategy design pattern?
-1
votes
0answers
18 views

Java program exit function not working [migrated]

i'm a newbie to java so i decided to create a simple program that prints out even numbers. I tried to make it exit a while loop if you answered no to the question but it just keeps on going. Here's ...
1
vote
1answer
73 views

How to concurrently write data in Java without locking?

How to implement a multi-threaded program in which each thread needs to write/output some data (in any order of course) but without the locking overhead that is involved with files or a particular ...
3
votes
3answers
150 views

How to open a desktop application through browser without a Java applet?

We run a cloud-based medical software, and a very important part of the program is bridging to an imaging software straight from our website, passing information through command line arguments. We ...
0
votes
2answers
85 views

Check if a variable is equal to any of several values

I'm trying to check if an integer is equal to any of several values and don't want to do this: int d = 0; if(d == 3 || d == 8 || d == 1) { System.out.println("d is one of the special numbers!"); ...
1
vote
2answers
86 views

Should method names getX and setX only be used for fields and have no other effects? [duplicate]

Should I avoid using getX() and setX() as names for methods that aren't "traditional" getters or setters? (Let's define traditional as it only gets/sets the field and has no other effects.) I guess ...
1
vote
3answers
135 views

Using System.err.println() for debugging in Java

System.err The "standard" error output stream. This stream is already open and ready to accept output data. Typically this stream corresponds to display output or another output ...
-3
votes
0answers
129 views

How can I deal with apathy in the workplace? [on hold]

I've recently been sent a meeting request to put forward a proposal to upgrade our Java version to 8. I'm quite enthusiastic about the features implemented in version 8 so I thought it would be a good ...
-4
votes
0answers
20 views

GCC Ada command line [closed]

[Windows 8.1, 64-bit, using the most recent MinGW] So, basically, I need to compile a .adb Ada file and get it's output .o file. Buut, I have to do this programatically - more specifically, in Java. ...
-3
votes
0answers
15 views

Spring batch design (Data enrichment) [on hold]

I have a working spring batch program that reads from a DB , the writes into a file. However I need to add labels to data so for example I need it to print student:John|LastName:Smith .. Etc my ...
0
votes
0answers
71 views

How to build full modular app [on hold]

I have full monolite app on java/scala and all modules work trough "Interfaces". For DI/IOC I use Guice. As example of structure:   How to organize structure of build for build different ...
-1
votes
0answers
48 views

BabysittingJob wont give me the proper output? [duplicate]

I am supposed to create an object with different fields for a babysitting job. and display all of the fields. This is what I have: public class BabysittingJob { private int jobNum; private int ...
27
votes
10answers
3k views

Is it okay to have objects that cast themselves, even if it pollutes the API of their subclasses?

I have a base class, Base. It has two subclasses, Sub1 and Sub2. Each subclass has some additional methods. For example, Sub1 has Sandwich makeASandwich(Ingredients... ingredients), and Sub2 has ...
-5
votes
0answers
42 views

Bitwise operation and mobile computing. Where does it help? [duplicate]

This is another Theoretical question that has to do with engineering as well. Please be patience to my question. Maybe it is unclear because my view on the subject is unclear and that's why I am ...
-2
votes
0answers
34 views

Best framework in java for responsive web application with simples 2/3 form and search page? [closed]

I want to architect and develop simple web based application with simple 2/3 forms and search pages and user administration, backend is oracle RDBMS. Can I know best responsive java framework ...
-2
votes
0answers
28 views

More efficient way to write this code [migrated]

I'm learning java and was making a program to go along with the board game clue. I type the name of who didn't do it and it takes them off the list. I want to evolve this program to be able to do ...
0
votes
0answers
5 views

How to apply custom drop-down properties for my custom JComponent [migrated]

I have created a custom swing JComponent and have applied it to my NetBeans v8.0.2 palett. The component works well and can be dragged and dropped into a JFrame (UI form) without any issues. My ...
2
votes
2answers
198 views

Why are the types in Java considered less 'strong' than haskell?

I asked this question a while ago - the answers were really helpful, and as I read them and the questions that were linked - I also saw this, and the first answer I think really addresses what I ...
24
votes
7answers
3k views

Should I validate a method call's return value even if I know that the method can't return bad input?

I'm wondering if I should defend against a method call's return value by validating that they meet my expectations even if I know that the method I'm calling will meet such expectations. GIVEN User ...
-1
votes
0answers
21 views

sending data from device to remote server [migrated]

My application is passing two value from device to remote server but it work in when i tested in bluestack when I install in real device it show a message like "Unfortunately app has been stooped" so ...
0
votes
0answers
18 views

accelerometer code in class [migrated]

I'm writing an app that show accelerometer readings, I was able yesterday to write all the accelerometer code in the main activity and it works fine on emulator and my device. But today I was trying ...
-2
votes
0answers
22 views

generating best fit from 3d datapoints [closed]

given N datapoints of point(x,y,z) how should I go about generating the best fit line for this dataset? Accuracy is more important than speed as the collection of best fit lines will be precomputed ...
-8
votes
0answers
37 views

Writing an application [closed]

I have done a lot of experimenting with all sorts of programming languages and am wanting to create a desktop application that can send and receive messages as well as notifications, etc from ...
0
votes
0answers
39 views

Testing if any two given objects are equal [closed]

As described in the title I want to write a code that can compare any given objects and check if they are equal. Here's a sample code: public static boolean equals(Object o1, Object o2) { if ...
18
votes
4answers
2k views

How much refactoring is acceptable? [duplicate]

I am currently in a project where one of my developer colleagues constantly refactors stuff on every ticket he's doing. We are using agile methodologies. I know that refactoring is a good thing to do ...
-3
votes
0answers
25 views

How to use Multiple class in javascript function for testmonial? [closed]

I Have Two Div I want Use this Class For Testmonial Show Please Tellme How I use 2 class in one Function.
1
vote
0answers
56 views

Simple REST API calls using Spring? [migrated]

Okay I'm having a simple REST API that is now running. I also got a mobile app (Android) that would be ready for some network communication. But here is the thing: I now got a fancy API created with ...
-4
votes
0answers
28 views

Arrays List and loops [closed]

I'm not really sure how I could arrange these two in code to combine them together. I start off with five groups of some amount of cards which I believe that I can use an arrays list. But then I have ...
-3
votes
0answers
23 views

Matrices Developing using Java [closed]

Okay hey guys, So am asked to develop a matrices program using Java the program have a class called Matrix represents matrix of the fraction Number(another class) the quastion is How To :The class ...
-4
votes
0answers
38 views

Why do we still have problems with foreign characters? [closed]

We want åäöÅÄÖ to work (for a custom cryptography) with Java. It seems that there is a problem whether åäöÅÄÖ are before Aa or after Zz. Which is it and which should it be? Am I mistaken that this has ...
-2
votes
1answer
54 views

InteliJ Git vs GitHub for Windows vs SourceTree [closed]

So I'm a bit curious as to what is the best practice when using version control. I've been using SourceTree(w/ mercurial) at work but have used as well for my course assignments with (Git). I've also ...
18
votes
5answers
2k views

If Scala runs on the JVM, how can Scala do things that Java seemingly cannot? [duplicate]

I just learned about Scala yesterday, and I'd like to learn more about it. One thing that came to mind, however, from reading the Scala website is that if Scala runs on the JVM, then how is it ...
-2
votes
0answers
11 views

Java SWING: JList holding multiple Components as a single item [migrated]

Here is my problem: I'm creating a window that is responsible for listing a layer, where it displays the layer's current image (in the form of a ImageIcon as of now), layer's name, and a checkbox to ...
1
vote
1answer
44 views

Keeping lists of Objects, some with, some without inheritance

Let's say I have two classes, Foo and ExtendedFoo where ExtendedFoo inherits from Foo. Foo has a method .getValue() which returns a number, ExtendedFoo also has .increaseValue() which adds to the ...
-2
votes
0answers
23 views

Finding the sum of columns in a Two Dimensional Array with rows of different lengths [migrated]

So i'm having a bit of trouble with my code in returning the sum of the columns in a two dimensional array with rows of different lengths. For example a 2X2 array works perfectly to calculate the sum ...
4
votes
3answers
209 views

Automatic builders/chain setters for Java?

Consider that code: FancyClass c = new FancyClass(); s.setParameter(value); s.setParameter2(value2); //a lot of parameters It is really naive, so we can use a builder pattern: FancyClass c = new ...
1
vote
0answers
67 views

Were Java and Flash necessary pre-cursors to JavaScript and HTML5? [closed]

Java appeared in the Netscape browser in 1995, with Javascript and Flash very soon after (I think). Java and Flash allowed programmers to add rich interactions to otherwise static sites, which can now ...
-2
votes
2answers
115 views

Is this a good game plan to become a fluent Java developer? [closed]

I am an efficient person, and I am trying to find the best method of becoming a great Java developer. Here's what I'm thinking: First, learn syntax and Object Oriented concepts. Practice it, and ...
0
votes
1answer
110 views

Java front-end, PHP/MySQL back end methodology

I have been basically out of the programming world for about 10 years, with only a bit of dabbling here and there with small Java utilities and one large Access database I wrote for someone, and some ...
0
votes
1answer
81 views

How to deliver messages from a communication interface to a core? [closed]

I want to develop an application in near future, where I will receive data via a communication interface. So there exists a Java class, that is responsible for getting the data. After the application ...
0
votes
0answers
28 views

Help with IDE features integrating with ant build scripts

I've been spoiled by relying on IDE generated scripts for a while. But for the project I'm on now I have to use, basically, custom ant build.xml scripts. This hasn't really been a problem. But I'm ...
4
votes
4answers
727 views

Should I edit a codebase's whitespace to conform to a coding style? [duplicate]

We have a large Java project (1m+ SLOC) with mixed whitespace - some files have tabs and some have spaces. It's tricky to make my editor work with whichever file I happen to be editing. We are ...
0
votes
1answer
98 views

Access fields of super class from derived classes [duplicate]

There is an abstract BaseGame class that will be inherited by specific game classes. This class has an attribute requestHandler that will be used in all subclasses and should be initialized in the ...
2
votes
0answers
53 views

Conventions for revision control with Maven/Jenkins

For a software project I am working on, we have a 'dev => QA => production' methodology. That is, we create a release candidate (deployed to Artifactory), give it to QA (deploy to QA systems and a QA ...
14
votes
5answers
1k views

Why does the TRACE level exists, and when should I use it rather than DEBUG?

In Log4J, Slf4J and a couple other logging frameworks in Java, you have two "developper" level for logging. DEBUG TRACE I understand what DEBUG do, because the explanation is clear. The ...
0
votes
3answers
183 views

Why does an interface extend an interface instead of implementing it?

In Java suppose that I have interface A: public interface A { // foo } I also have interface B: public interface B extends A { // foo + bar } Why does interface B extend interface A ...