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

Spring Project - No message found under code 'user.status.A' for locale 'en_us'

I am attempting to maintain separate files for different types of "messages" (user messages, field labels/buttons, data values). In this attempt I am trying to get the description of different data ...
0
votes
0answers
19 views

Design pattern for XML parsing on different files

I have two XML files with different structure. I have written two SAX Handlers for it. I am creating these handlers object from a utility class. public class Util { public static void parseFile1() ...
0
votes
2answers
83 views

When I create an object, is fresh memory allocated to both instance fields and methods or only to instance fields

I have a following class class Student{ int rollNumber; int marks; public void setResult(int rollNumber, int marks){ this.rollNumber=rollNumber; this.marks=marks; } public void ...
-2
votes
0answers
21 views

Steps for Oracle Certification [on hold]

This is not a error question.I need some advice from yours in career path. Currently i am working as an Android Developer last 9 months.And now planing to move ahead in pure Java Development. I ...
-2
votes
1answer
71 views

JAX-RS and application wide business logic/resources. My brick wall has be found

I think I'm definitely hitting a brick-wall in understanding how to implement this. I would very much appreciate any assistance in this. All my JAX-RS links, Oracle, IBM and Stack overflow links ...
0
votes
0answers
87 views

Do thin fluent builder method chains have any need to be “extensible”?

In an environment where refactoring is difficult extensibility can be a life saver. However, this is no excuse to over engineer code. Given that a thin fluent builder method chain is backed by well ...
0
votes
0answers
36 views

How to connect Android App to MongoDB deployed on Google Cloud

Currently I am working on a simple app which will be able to connect to MongoDB which is deployed in Google Cloud. I have set it up MongoDB ocaly on my computer and I have made a little JAVA console ...
-1
votes
1answer
73 views

Naming of methods that perform some actions under some condition [on hold]

I often write such methods to avoid duplication in code and I give them name such as doSomethingIfSomeCondition(). For example: public class TaskDownloadFile { private boolean started; ...
2
votes
3answers
119 views

Proper interface for calculator library?

As practice, I'm planning to implement a multivariable calculator library. The idea is that you can define a function, such as f(x, y) = sin(x)^2 + 3*y^3, and then you can evaluate it with specific ...
-3
votes
0answers
8 views

incorrect output for set input [migrated]

So I almost have this code correct but it's not giving me the correct output for some reason and I can't figure out why. This is what I have. That is what I have so far but I need the output to be ...
0
votes
2answers
221 views

Organizing code in a 2 man team

I've been working with a buddy of mine on a school project. We forecast it'll take ~2 months, so it isn't a small scale project at all. Communication and splitting the work effectively has been a ...
0
votes
0answers
36 views

Mixing newable and injectable in a Callable

I recently read http://misko.hevery.com/2008/09/30/to-new-or-not-to-new/ which discussed newable vs injectable objects. What would you do if you needed to make a Callable that talks to some service ...
1
vote
1answer
139 views

Java Desktop Application Requirement - Is sockets the preferred choice ?

I'm currently working on a requirement for a desktop application - using Java If for some reason the GUI crashes, it shouldn't affect the background process. Once the GUI is restarted - the ...
0
votes
0answers
84 views

How far to go when future proofing fluent-method-chained-DSL test code?

Is it worth implementing interfaces, or using the getThis() trick, or even static factory methods to future proof against the need to extend this DSL? The current design is a pair of thin ...
3
votes
2answers
123 views

To subclass or to wrap for “default” implementation?

I'm creating a toolset in Java consisting of many Natural Language Processing (NLP) tools, such as Tokenizer, POS tagger, Lemmatizer, Sentence parsing, etc. I want to put all good and publicly ...
1
vote
0answers
62 views

How to efficiently handle related data in MVC?

Talking about MVC with servlets and JSP's, in a context about products and manufacturers , when querying the application for a list of products: the servlet loads a list of products from the ...
1
vote
1answer
145 views

Do you use static keyword to declare single instance pattern? [duplicate]

I just come across this code and find it interesting to know whether you consider this as another single instance pattern? public class Initiator { private static String str; // there is many ...
0
votes
0answers
40 views

How to get values to output as a currency? [on hold]

I am working on calculating change, and investment rates with java. My code gives me the correct values, but does not display them how I'd like. For the first part, when I calculate the dollar amount ...
-2
votes
0answers
31 views

How to change the alignement of contains in a JScrollPane [migrated]

I am working on a GUI to manage bank accounts. I use a JPanel in a JFrame to list all the account register as buttons, and a JScrollPane to extend the view. When I run the program, the scroll bar ...
-2
votes
0answers
41 views

Auto generate project status reports thru email text analysis and summarization

I hate writing status reports for my boss. I usually spend an hour each Friday morning scanning emails trying to remember what the heck I did for the past week. A typical report looks something like ...
0
votes
0answers
8 views

How to delete .tmp file in fileupload struts2 [migrated]

I have used file-upload (common fileuplod) in strtus-2.3.15.3 . There is one Form in my .jsp with multiple field with many diff type(textfield,textarea,hidden,file) including FILE and obvious SUBMIT. ...
-3
votes
0answers
17 views

share button in custom listview doesn't work [on hold]

I'm following share a text with button in custom listview but it doesn't work . this is code for OnClick in ListViewAdapter.java : OnClickListener clickListener = new OnClickListener() { ...
0
votes
0answers
47 views

Floating point number to binary

Which Algorithm does java uses to convert floating point number (Ex:0.15625) into binary(0.00101). Whether java uses normalized form or denormalized format ? If i type "float ab=0.15625" in java ...
-3
votes
0answers
27 views

Why wait and notify is declared in Object class instead of Thread [duplicate]

I need practical answer of this question Why wait and notify is declared in Object class instead of Thread ? answer with example will appreciated.
1
vote
2answers
97 views

Changing message without redeploying / restarting application

Question: In java application, How to change error message or simple alert text without redeploying / restarting application Closest answers I could think up (1) is to have a new error messages in ...
-3
votes
0answers
23 views

Drag and drop model for modelica [closed]

Is there any way to connect Modelica with JaamSim? As I want an open source GUI with drag and drop option for simulation with Modelica running in back-end. I have already tried SimForge but there is ...
-2
votes
0answers
75 views

How to plan development [closed]

I am a self-taught 17 year old who knows Java and C# as well as I can, be learning them for over a year but I have never coded anything so therefor no experience.Me and my friend are working together ...
-4
votes
0answers
56 views

This program in Java doesn't stop executing! [closed]

I have written this program but it doesn't stop executing. Can you help me with it? /* * To change this license header, choose License Headers in Project Properties. * To change this template file, ...
0
votes
0answers
67 views

Designing a simple file manager [closed]

I've been trying to come up with the best way to design my file manager for a project. I need to work with many file implementations and I have a File class made of 2 classes inside: Data and ...
-2
votes
1answer
136 views

What is the largest size a HashSet or TreeSet be? [on hold]

So I am working on a solo project that involves a lot of strings. In one of my smaller test cases there will be at least 70 million elements. So my question is, what is the largest possible size a ...
-2
votes
0answers
48 views

How to extract JSON schema, using Java, from data without using available libraries? [closed]

The problem in extracting schema from any given data is that they can have other JSON objects embedded in them which in turn have others. Also the types of the values in the name-value pair have to be ...
2
votes
3answers
236 views

Could the creation of many methods in Java affect performance? [closed]

I was told by a colleague that in Java, the performance may be worse if we create more methods, stacking many methods calling over them in JVM, specially in a Java EE environment. This seems to ...
6
votes
2answers
436 views

Which is a better pattern (coding style) for validating arguments - hurdle (barrier) or fence? [duplicate]

I don't know if there are any accepted names for these patterns (or anti-patterns), but I like to call them what I call them here. Actually, that would be Question 1: What are accepted names for these ...
-2
votes
0answers
32 views

Which one is better for Offline chat using JMS either RabbitMQ or ActiveMQ? [closed]

I have a lot worked on the Java Standard Edition; and now I am new comer on the Java Enterprise Edition. Currently I am working on Offline chat module of Enterprise level Application using Spring ...
0
votes
1answer
91 views

Making a configurable Java formatter? [closed]

AFAIK there's just java.util.Formatter and java.text.Format and AFAIK none of them is extensible. I mean not subclassing, but the possibility to specify how to handle objects by class, e.g., saying ...
0
votes
0answers
4 views

Problem with opening JFrames from LWJGL [migrated]

I'm making a program that uses LWJGL to render a Display window, and it also listens for keyboard input to prompt it to open a swing window. The problem is, upon the first keyboard prompt, it opens ...
-5
votes
0answers
53 views

Java Graphics 2D rotation problem? [closed]

I have been trying to program a game lately, wherein I drew a rectangle onto the screen using ImageIcon. Later I realised, anything drawn on the screen there after rotates along with the image drawn ...
2
votes
1answer
200 views

What is the advantage of using Direct Web Remoting over a REST web services design? [on hold]

I have an enterprise Java web application deployed in tomcat. I am looking for ways to integrate a HTML & JS UI with the mid tier java code. So far, looking around I have found that there are two ...
-2
votes
1answer
47 views

Rename PDF extracted Pages File from a Single Booklet PDF in correct sequence [closed]

I have huge PDF files which are in booklet format. example, Assume a booklet pdf file has 24 pages which each page contains 2 pages which is in two sides - left side and right side. The first page ...
0
votes
0answers
12 views

Java for loop: why can't I declare two variables in the for loop 'header'? [migrated]

I always wondered, why doesn't this compile? for(int i=0, int q=0; i<a.length; i++){ ... } Why doesn't Java allow me to declare more than one variable in the for loop 'header'? Is there a ...
1
vote
0answers
71 views

DataMapper for a MMO game plugin to send packets

I am working on an plugin for some game-server. The information about the plugin is not really necessary. Few points you might find helpful to answer to this question: The server The server is ...
0
votes
5answers
340 views

Liskov Substitution and SRP Principle violation - how best to structure this scenario?

While learning SRP and LSP, I'm trying to improve the design of my code to comply best with both of these principles. I have an employee class that has a calculatePay method on it. Firstly, I believe ...
0
votes
1answer
110 views

Simple unicode application?

I want to create simple language learning applications to help friends in learning languages. A simple Java console application would do the trick, but the Windows console does not seem to handle ...
-3
votes
1answer
73 views

How valid is the statement “write once, debug everywhere” by some Java users? [duplicate]

How valid is the statement "write once, debug everywhere" by some Java users? If it is true, what is the effect to us?
1
vote
3answers
120 views

Null checking whilst navigating object hierarchies

I had to implement some code which traversed a small object hierarchy to fetch a value and display it in a TextView object (this is Android / Java). I had to do this 6 times to populate 6 TextViews ...
-2
votes
0answers
13 views

Java GUI with JFrames [migrated]

Today I started learning Java GUI and tried to create a simple window on my Ubuntu. I am using jre7 for now. I wrote code exactly from tutorial because from experience there are stuff that doesn't ...
2
votes
2answers
106 views

Recreating files from shell script or java?

I have java application which takes a file, which is created by a process running on terminal. I start the process using a small shell script. Then run the Java application and it reads the file ...
-2
votes
0answers
32 views

How to connect a Django app with a Java Web app using JMS

I'm dealing with my DB systems course project, it's a stock exchange simulation app using Oracle 10g, the deal is that the support is for Java, but i'm going to do this in Python. The last iteration ...
2
votes
1answer
194 views

Any OOP design pattern that is somewhat representative of all of the SOLID OOP design principles at play?

I'm trying to teach an object oriented design principles course (on SOLID) at a training institute. I also want to teach the students a few OOP design patterns such as factory, singleton and one ...
0
votes
0answers
17 views

Apache Wicket, updating data without using a form, is it safe?

I have a ListUser.java class with a datatable, displaying UserData information, displays 4 columns, the last column is an AbstractColumn that has on it's populateItm method has added a inner class ...