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

What does 'name' attribute signify in any java.awt component?

With the below program, am trying to find the names assigned to all the components part of the GUI. public class AWTCounter extends Frame implements ActionListener{ private Label lblCount; ...
0
votes
1answer
127 views

Injectable, Poppable Stack

Background A project involves converting a relational expression map (rxm) to an XML/SQL statement. The map resembles: root > people, # "root" keyword starts the document ...
0
votes
1answer
32 views

How to display an inward spiral matrix

Suppose I have the following matrix with values 1-25 as input to my program . The inward spiral should give me the output 13 18 17 12 7 8 9 14 19 24 23 22 21 16 11 6 1 2 3 4 5 10 15 20 25 . What could ...
-2
votes
0answers
22 views

Java Socket or SocketChannel

I am designing a server for a remote file store in Java and trying to decide whether to use asynchronous java.nio.SocketChannels or the older blocking model with Sockets. What kind of factors should I ...
0
votes
1answer
63 views

Possible way to make java class builder more abstract by using interface required keys

I'm looking for a more abstract pattern for builders that handles required fields without the need of writing a validator that checks if all requried fields are set. I like this builder. But is ...
0
votes
0answers
6 views

retrieving character from string.length() , using a FOR statement [migrated]

I am implementing the Luhn algorithm using a for statement and a string. My question is, does "j" get assigned the value of the character at that location of the string(the digit), or does it get ...
2
votes
2answers
178 views

Can a Java Boolean be used for ternary logic?

I'm trying to make a basic cache of a boolean value, and I did it like such: private Boolean _valueCache = null; private boolean getValue() { try { if (_valueCache == null) { // if cache ...
7
votes
0answers
75 views

Haskell build and artifact environment similar to Maven

I used to be a Java developer for a long time, but recently, I joined a Haskell team. In the java world, if you have a large project, with several teams working on it, a common approach is to use an ...
0
votes
1answer
120 views

How/Why do we design “Data abstraction” and “Abstract Data Type”?

I learnt that Data abstraction is a barrier between "representation" and "use". I learnt that Abstract Data Type is some collection of selectors and constructors, together with some behaviour ...
0
votes
2answers
73 views

What naming convention should you use for data objects solely meant for parameters

This is my pseudocode for DAL: CusOrderDTO GetCustomerOrder(DateTime OrderDate, string customerCode) CusOrderDTO orderSet = new CusOrderDTO() * query data from database, populate CusOrderDTO ...
0
votes
0answers
22 views

How do I return a string from a servlet without leaving the page? [migrated]

Here's the picuture: I have a html/jsp page with a form on it. <div id = "divAttributes"> <form id = 'fid' method = "post" action = "RunQuery"> Ird Number: ...
-3
votes
1answer
66 views

Java Start JNLP without paying to certificate authority?

I've noted that now it is difficult to run Java Web start files (JNLP) by Oracle for Java8, without a proper certificate, due to "security reason".It is breaking thousands of applications across the ...
1
vote
1answer
76 views

Is there are any common pattern/practice to handle exception list (Java)?

Suppose I've got a sophisticated parser for something. And a I don't want Throw Early/Fail-Fast strategy. If I've got multiple problems, i want to have list of exceptions in my log file because I want ...
-1
votes
3answers
154 views

How to design a solution that needs dynamism using Inheritance [on hold]

I have below code/classes/interfaces: An Interface: public interface Animal<A extends Animal<A>>{ void fight(A otherAnimal); } 2.Tiger class which is implementing Animal ...
-4
votes
0answers
73 views

Type checking in dynamic language [on hold]

from module operator.py we have functional abstraction def concat(a, b): "Same as a + b, for a and b sequences." if not hasattr(a, '__getitem__'): msg = "'%s' object can't be ...
1
vote
3answers
452 views

Where should I put bindings for dependency injection?

I'm new to dependency injection and though I've really liked it so far, I'm not sure where bindings should go. I'm using Guice in Java, so some of what I say might be specific to just Guice. As I see ...
0
votes
1answer
101 views

Styleguide when coding in a static language

I am currently a junior engineer and keen on learning best practices and expanding my experience. My question concerns any static programming language such as Java, C#, C++ etc. When I am writing ...
1
vote
2answers
85 views

MVC like design with interfaces: How to handle basic objects?

I have an (android) application and decided that the presentation layer will get data only through strict interfaces from the controller. I am at the point where some basic objects need to be passed ...
2
votes
1answer
34 views

Can tools.jar from OpenJDK can be installed in public repository

Is it legal to install tools.jar from OpenJDK in public maven repository? I found at least three topics on the Internet which conclusion was that such action is forbidden for jar provided by Oracle, ...
0
votes
0answers
24 views

Linking Javadoc Page from Github [migrated]

I have been working on Github project Android-Commons. It is a collection of common Android Utilities. I have made documentation for Project code(See here). What I am facing issue is with I am not ...
0
votes
1answer
45 views

Server with different instances [on hold]

I have one application developed in Spring Framework and this application deals with large amount of data.So it would be better if I will give a dedicated application or separate instance to each ...
-4
votes
1answer
33 views

Create a main method to run the below code

I'm learning Java. I wonder how to run the below code? public class Test01{ public interface Printable{ public void print(); } public class PrintRectangle implements Printable{ public void ...
-1
votes
0answers
6 views

Is there a library or tutorial in creating a report designer [migrated]

My Company is asking me to create a report generator. Seems easy enough as of itself, but the catch is that it has to be dynamic. It has to be dynamic in such a way that we don't need to program ...
0
votes
0answers
37 views

web requesting - time competition - javascript? [on hold]

first of all, I would like you to excuse my english and description of the problem. I am not english native speaking, so I am trying my best.... Before you say, that is am abusing some server- I need ...
3
votes
1answer
276 views

Scheduling a few CPU-intensive tasks

I need to schedule a small number of CPU-intensive tasks to run every so often, reading from shared data and writing to dedicated buffers. I don't necessarily want to roll my own scheduling, but am ...
0
votes
1answer
312 views

MVC: How to Implement Linked Views?

I'm developing a java application to visualize time series. I need (at least) three linked views, meaning that interaction with one of them updates the others. The views are: A list represents the ...
4
votes
1answer
56 views

Should I implement the consumer/producer pattern in my java video app, and if yes, how?

I built a small video frame analysis app with desktop Java 8. On each frame, I extract data (5 doubles now, but could expand to a 1920x1080x3 OpenCV Mat in the future). I would like to store this data ...
15
votes
3answers
1k views

Which version of Java should I use for a desktop application to reach the most users? [on hold]

Am I correct to assume that most end users are using an older version than Java 8? Since I do not want to force people to upgrade in order to use my application, should I plan it to use Java 7 or even ...
1
vote
1answer
127 views

Hypothetical : What restrictions will I need to add to Java so that I can remove its GC? [on hold]

This is a hypothetical, yet very technically precise question I'm trying to ask all the compiler/static analysis programmers. I'm trying to understand the extent of prohibitive features I would need ...
2
votes
4answers
92 views

Single method with many parameters vs many methods that must be called in order

I have some raw data I need to do many things to (shift it, rotate it, scale it along certain axis, rotate it to a final position) and I am not sure what the best way to do this to maintain code ...
-5
votes
0answers
38 views

I want e-books related to programming [closed]

I am new in programming world! . I want e-books related to JAVA , and C#.net . Best Regards, Abdulaziz.
1
vote
2answers
195 views

A 'task' system which has an ending, to get ready for next task

I want to make a system, so that there are certain tasks. For example, let's talk about a game. I want to make it so there are 100+ tasks doing different things, but when the player's magic level is ...
0
votes
2answers
201 views

How to manage data flow between UI components?

I have been trying to use classes that implement ActionListener to respond to user input. I'm consistently noticing that for an action listener to communicate the event to other objects, it has to ...
0
votes
0answers
46 views

Java write to text file from multiple threads

I have a thread which read and insert new lines in same file. I must synchronized that file so that no other thread is not accessing the file at the same time. Here is how i will synchronize a file ...
-3
votes
0answers
29 views

Specific knowlege and skills for making android apps [closed]

I know this question has probably been posted already but i couldn't find a sufficient answer. I'm interested in learning how to make android apps, i already know how to code in java and i know oop. ...
0
votes
1answer
48 views

Lock object in base class: private or protected? [on hold]

I have a base class that contains some lists, queues, and other fields which determine its state. In the base class I only access these fields within a protected lock object since there could be ...
0
votes
1answer
40 views

How is ServletContext created?

When the webapp gets loaded the container will create the ServletContext. There is only one ServletContext per webapp per JVM. The ServletContext object is contained within the ServletConfig ...
2
votes
1answer
224 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 ...
2
votes
2answers
339 views

Why would someone use @Native annotations?

link : http://download.java.net/jdk8/docs/api/java/lang/annotation/Native.html In Java 8, there will be @Native annotations. Indicates that a field defining a constant value may be referenced ...
-2
votes
0answers
22 views

Managing and accessing instances of classes [closed]

This is for an assignment and I am stuck on how to access a class that would be instanced with user input. I cannot seem to see a way to instance a new AddressBook with a unique identity from user ...
-1
votes
0answers
43 views

How to do frequent deployment / rolling upgrades for a Java app?

We're developing a SaaS app in Java, built with Maven. It runs on Amazon on a (potentially) large number of servers. We'd like to deploy changes every day or two. We have a ton of unit and system ...
-2
votes
0answers
40 views

Is it viable to use Java reflection for serialization/deserialization? [closed]

I have quite a bit of experience with C# and .Net reflection, and have written my own serialization/deserializaiton module based on using .Net reflection to analyze the objects and their members. Now ...
0
votes
0answers
3 views

Constructor Bug [migrated]

I am trying to make a class that represents an integer with 100 digits. Not so much because I need it, but to learn more about constructors. The constructor takes a String (all numbers) and places ...
0
votes
2answers
379 views

Is factory pattern a right pattern for the situation described here?

Is factory pattern a right pattern when we want to consolidate the related objects? Problem - In the Set-top box, I have a user-io, basically the interface to control the settop box - The user-io can ...
2
votes
2answers
207 views

When to use a SortedMap interface?

The rule in programming is to use the most general interface possible. But the difference between Map and SortedMap is more subtle. They compile to the same bytecode [I think] No additional safety ...
1
vote
1answer
126 views

Problems with OO design for application with pluggable components

I'm trying to refactor an ugly code and make it easly extendable in the future. The application should be nothing else but a series of components that have input(s) and output(s). The components ...
7
votes
3answers
538 views

Does current JIT optimize generated machine codes for branch prediction based on runtime statistics?

Some JVMs would compile Java byte code into native machine code. We know that there are lots of optimizations we could apply for that. Recently, I also learn that a branch operation may block the CPU ...
-2
votes
0answers
24 views

NullPointerException from tring to get seperate RGB components [migrated]

I am trying to get the seperate RGB components from each element in a 2D color array,but it keeps throwing a NullPointerException and I am not sure why. It might be something small that I missed, so ...
0
votes
1answer
66 views

Return values and exceptions [on hold]

I wrote simple function that returns a string depending on which condition is TRUE. Here is my code: private String getMyString() { if(!mStrigMember.isEmpty()) { return mStrigMember; ...
2
votes
5answers
153 views

Implement multiple separate interfaces or interface hierarchy

I've been refactoring one of my projects recently and ran into a decision I have to make. I have several interfaces: Entity: Something in the game world Actor: An Entity that can perform actions ...