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
11 views

Maven java compiler with errors : incompatible types

I'm using https://github.com/webdevwilson/magento-java to connect to my store magento with JAVA for integration system. I installed Maven, openjdk-6-jdk, set up home for java, etc. My information is: ...
1
vote
0answers
9 views

Why do we need an instance of the Scanner Class to get an Input on Java?

I asked this in Stack Overflow, but people got a bit mad at me :( Maybe you guys can help me out! Java is object oriented, but, why do we need to create an object from the Scanner Class to get input? ...
-2
votes
0answers
8 views

Odd Errors Displayed Only in Console When Attempted to Run Program

So I'm watching a tutorial to learn how to program in Java using Eclipse. So I got a few episodes in and I had to clear out all out the errors. I looked around and found no more errors so I tried to ...
-5
votes
0answers
10 views

Exception in thread “main” java.util.NoSuchElementException [on hold]

I have these below two classes and what I am trying to do is trying to run the APP class so it can take command line arguments instead of having a fixed file name in the code When I execute the code, ...
2
votes
4answers
358 views

Design decisions while porting a non object-oriented C program to Java

Background: My boss made a comment on porting a C program that acts as some a simulator that communicates with a remote process through sockets to Java. He didn't assign it to me, or to anyone for ...
-4
votes
1answer
40 views

New to Java, Question Concerning Loops [on hold]

I am new to Java. I was wondering how to complete a user-defined number of loops. Here's the code I have right now: package diceroller; public class DiceRoller { public static void main(String[] ...
0
votes
0answers
57 views

Make a program deactivate after time [duplicate]

What I am referring to is a free trial. I would like to have a program that runs to a user who downloads it just like normal. However, I want the program to deactivate and become useless after a ...
-1
votes
0answers
27 views

Optimal Persistance Solution in Java [on hold]

I've been working with Java and Spring for 2 years now. Before hand I work in PHP writing straight SQL, I would say I'm more SQL minded than ORM minded. I have struggled to really find a persistence ...
-5
votes
0answers
12 views

popup help window in a java application [on hold]

I need a java netbeans program to do the following task. Like auto completion, In a text area after typing a word and clicks enter it should invoke the search engine and should show the search ...
1
vote
1answer
29 views

Approaches to Modeling a Graph Database over the Google App Engine Datastore?

I want to model a graph database over the Google App Engine Datastore. I am currently working on creating a Link entity to model the concepts of link/edge/relationship to the graph of objects. I am ...
-3
votes
3answers
77 views

How do I check my object's class in Java? [on hold]

I would like to know how to check what class my object originated from like if Object JoeThompson came from Supervisor or Programmer?
-4
votes
0answers
21 views

Sites to improve Java programming skills [on hold]

I am a Java coder with 3.5 years of Industry experience. I wanted to improve on my Java coding skills on Collections, along with design patterns. Any sites where we can learn i get small real time ...
-3
votes
0answers
21 views

Mixing then printing arrays, but they all end up the same anyways? [migrated]

I'm making a sudoku game. I have an array (puzzle[][][]) containing nine other arrays (zone1[][]-zone9[][]), which each initially contain {{1,2,3},{4,5,6},{7,8,9}} (and they're assigned those values ...
-4
votes
0answers
30 views

Redistributing data loading [on hold]

I am writing a system that does a lot of http requests, and fetches a lot of json data. I have a goal to fetch a lot of data within short period of time. Just to give some measurement: one request ...
0
votes
2answers
109 views

whats the relationship between integration testing, TDD and Agile methodology? [on hold]

I recently attended an interview and was asked whats the relationship between integration testing, TDD and Agile methodology? I am still puzzled how to answer the question !!
3
votes
1answer
122 views

Should a new type be created though it only wraps a single field?

Say I have an interface Species that's defined as public interface Species { String getId(); String getDescription(); } The question is simply this: Should I create different classes to ...
7
votes
4answers
823 views

Should Objects with lots of fields be broken up? [duplicate]

When I have an Object that has lots of fields is it better to have them all as fields or try to find logical groupings as their own Objects and make those the fields? I guess it comes down to which ...
5
votes
4answers
185 views

Is Java package level scope useful?

I understand the idea of package scope, and at times have even thought I wanted it. However, every time I set down with a serious intent to try using it I discovered it did not fit the needs I ...
2
votes
3answers
91 views

Responsibility of the small business logic: in a class or in a method?

I have separated business logic to many small blocks. Each block can be coded in small number of lines. Where should I put the block code? [A] in a method, grouped in the class by some same feature ...
1
vote
3answers
125 views

How can I create an abstract parent class which uses data from an inherited class?

I'm getting my feet wet with Android app development and tying to find a good way to manage database interactions across multiple similar objects. My goal was to have a structure like: public ...
1
vote
0answers
50 views

Detecting surface faces of a huge 3D mesh/grid

I've written a module in my application that creates a mesh from existing coordinate and face data. The number of vertices in the mesh could easily exceed 10 million and the same goes for the faces. ...
-1
votes
0answers
53 views

Backpropagation in layman terms [on hold]

I've been studying neural networks, and I'm beginning to understand the basics. I know what the backpropagation algorithm does. It feeds sample input and calculates an error against a given output. ...
1
vote
3answers
213 views

Would combining enums with static strings in java be sloppy?

Currently my team has a number of constants defined as static final strings. I want to be able to iterate over these strings as if they were an enum in one location, but everywhere else they are used ...
1
vote
1answer
84 views

What is the point of the dao layer? [closed]

With the current technologies which are pretty good (JPA, Hibernate, others), what is the point of the DAO layer? It's very rare for a project to switch its backend from one vendor to another, so it's ...
0
votes
0answers
15 views

How should one model an ExchangeService object (in ews-java-api) for sharing MS Exchange connections?

I am creating an application which uses ews-java-api to connect to an MS Exchange server. Once the connection is authenticated, the api dictates use of ExchangeService object for searching mailboxes, ...
-1
votes
0answers
18 views

Segmented file downloading potential gains vs excess overhead/problems

I'm writing a download manager, i want to get as much speed as i can from my downloads and I'm thinking about implementing segmented file downloading with conjunction to parallel download for each ...
2
votes
1answer
44 views

Android Pass Data between fragments

I have a question about passing data using bundle between fragments. I need to pass the URL from a Product object to the next fragment, so I don't know which is the best approach: to pass only the URL ...
0
votes
1answer
78 views

Collections.sort question

My question maybe related to this question - Encapsulating Internal Data Structure I have a class LCTile.java which contains a Coordinate.java class. Coordinate.java that contains latitude and ...
0
votes
0answers
40 views

Securing HTML/JavaScript only web app / JAX-RS Backend [closed]

I am prototyping a small web app where the frontend will be a pure HTML+JavaScript+JQuery which consumes services from a JAX-RS backend. The application has started to have a shape now but I find ...
3
votes
2answers
174 views

Converting static utility class into singleton

In company where I work we have lots of "utility" classes, each has lots of code inside (thousands of lines), and they are all static. And one static methods call anothers. The problem here is that ...
-4
votes
1answer
148 views

Comparing the Java language to non-Java JVM languages [closed]

I was contemplating on the necessity of different non-Java languages coming up on the JVM. Apart from syntactic sugar and built-ins, does any of them actually exploit some corner of the JVM, which has ...
-1
votes
2answers
129 views

Modelling a parcel management application

Scenario/Context: I am working on an application which would find out the highest volume of parcel delivery based on the pin code of a particular area by reading a text file which has the list of ...
1
vote
1answer
99 views

Porting security from Java/.NET to PHP

This probably a rather naive question given my limited knowledge in the code I've been looking at, but I want to get my head around it before I start diving into writing actual code myself. I'm ...
4
votes
3answers
152 views

Track Bug fixes in code

I am working in a project in which at many point I need to change the code and fix the bug of the system but how can I inform other team members about this change? Usually I add single line comment to ...
-1
votes
0answers
105 views

What is abusing static? [duplicate]

Many people are always telling me not to abuse static in Java. What does that mean and why should it not be overused? The most recent case where I was told not to abuse static came when coding a ...
4
votes
1answer
91 views

How to load environment configuration

In Java the typical way of storing configuration is by using property files. So I have several such files, one for each environment type (dev, test, prod, ...). This configuration is needed in ...
0
votes
0answers
24 views

Android TranslateAnimation :: How to get the Speed of Mass Object

I'm currently having a project for making a springs-joint effect on android. And With two objects : A Mass Object A Springs (for hanging the mass object) And this link is my GIF animated of the ...
5
votes
4answers
281 views

Is using object of main class better than using static main method? [closed]

I have noticed in java programs at least, that people tend to prefer to start their programs by creating and instance of the class that contains the main method, and activating a non-static method ...
24
votes
8answers
2k views

Is there any practical way for a linked node structure to be immutable?

I decided to write a singly-linked list, and had the plan going in to make the internal linked node structure immutable. I ran into a snag though. Say I have the following linked nodes (from previous ...
1
vote
4answers
206 views

What are the differences between class variables and instance variables in Java? [closed]

I'm very new to Java and want to be difference between class variables and instance variables. For example: class Bicycle { int cadence = 0; int speed = 0; int gear = 1; } How are ...
0
votes
2answers
63 views

Implementing a component that provides interfaces in a component-based framework [on hold]

I'm currently trying to develop a small white box component-based Android framework, but I have a doubt about which is the best way to implement my components and interfaces. An architecture of one of ...
1
vote
0answers
45 views

Shenandoah for OpenJDK? [closed]

I am very interested in the Shenandoah "pauseless" GC slated for the Oracle JDK in 2016 (Java 9 or 10 I presume?). Moreover, I'm wondering whether Shenandoah would eventually become incorporated with ...
1
vote
0answers
78 views

When is it justifiable to use pair programming and when is it not? [duplicate]

On the software project I'm working there are 4 teams of 6 people. The project itself is a moderately complex distributed system, but the current user stories are mostly about implementing CRUD ...
0
votes
0answers
58 views

Selenium Testing w/ dynamically generated element id's: XPATH or CSS selectors?

Background: I'm an intern tasked with learning Selenium; my organization plans on having QA/Testing use it to simplify testing. We use JSF and WebSphere Application Server. One of the persistent ...
9
votes
1answer
136 views

How to keep code examples in javadocs up to date

I'm working on a small library that provides implementations of basic, well known string metrics. Mostly for my own education. So development happens whenever I've got a bit of spare time. Because of ...
3
votes
3answers
282 views

'Encapsulation Vs Performance' trade-off in a lockable linked list

Main purpose of encapsulation is to protect in-variants of any class(in java). Here is the complete code for class DList/class lockDList/class DListNode/class LockDListNode. class DList and it's ...
1
vote
0answers
114 views

How do I set a final field via a setter? [migrated]

I have the following abbreviated class: public class Employee { private final float pointPosition; public Employee(float pointPosition) { this.pointPosition = pointPosition; } ...
-1
votes
0answers
18 views

Problems with storing plain text and byte information in the same file [migrated]

I am supposed to develop a subsystem to store certain business data in a file and I am running into a problem, but first some requirements I have: It has to be 1 file for the entire data. The data ...
2
votes
1answer
132 views

Should I force the user to wrap the arguments, or allow them to pass in the data at the cost of having more arguments?

I have the constructor: public class Player { final private DoubleDuple position; final private DoubleDuple momentum; public Player(double xPos, double yPos, double xMom, double yMom) { ...
2
votes
1answer
64 views

Does declaring a field as final force redundancy in the constructors?

I have the following abbreviated class: public class Player { final private DoubleDuple position; final private DoubleDuple momentum; public Player() { position = new ...