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

-1
votes
1answer
26 views

Inheritance vs Association in this example

I'm designing a very simple fixed asset management system in Java. The system consists of the following entities as displayed in the following ER diagram. My problem is the design approach to be ...
0
votes
1answer
340 views

HTTP Session: A single object or multiple?

I tested two approaches to store session data: The classic: 1 key, 1 object (And every key as static final String in a class) "user" --> UserObject "preferences" --> List ... An ...
0
votes
2answers
178 views

What type of structure is this in java?

I was reading the following code listView.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) ...
2
votes
1answer
73 views

java CopyOnWriteArrayList: Why do we have to make a full copy of source data?

I have a lot of confusion about java CopyOnWriteArrayist. I know, when we have a modification on it like update,insert of set, it will lock the whole list, copy out a total copy of the source list, do ...
-5
votes
0answers
40 views

How to make a 2D to 3D converter in Java? [on hold]

I know that there is software out there that creates 3D models/scenes out of a series of images. I am very interessted in how that works and so I would like to do this on my own in java. But how does ...
0
votes
1answer
126 views

Reflective discovery of an inner class in an API

Let me ask you, as this bothers me for quite a while but appears to be subjectively the best solution for my problem, if reflective discovery of an inner class for API purposes is that bad idea? ...
0
votes
1answer
168 views

How to move away from hardcoded paths in our build processes

We have a set of Java tools that are built and run locally. Whenever one of the devs commits a change, everyone else (including non-developers) need to do an update and build the tools. Everyone uses ...
0
votes
2answers
68 views

Snmp Poller in java Single and Multiple thread [on hold]

I'm trying to make a Network Management System application. For the polling, what is better, single thread for all devices or multiple thread (i.e. individual thread for an individual device)? My ...
0
votes
0answers
46 views

How do I access the data in Java objects returned by User.getAddresses() and User.getPhones()? [migrated]

In com.google.api.services.admin.directory.model.User, many methods, such as getAddresses() and getPhones(), return a Java object that I can’t figure out what to do with. Using toString(), I can ...
-2
votes
0answers
62 views

Difference b\w copying a file across network and sending it through programs [on hold]

I am trying to send a 200 MB file to almost 50 client computers in the network using my Software written in JAVA which take around more than 1 hour. But its not same when i try to copy the file ...
0
votes
1answer
307 views

What is the traditional way to maintain extensibility in a database-driven application like this?

I'm working on a simple application for a game in Java that allows a user to record whether they have collected a given item and how much experience it contains. This will work for multiple item types ...
1
vote
4answers
325 views

Should all programmers know how to solve algorithms, etc [on hold]

I'm 15 and have been programming for about 3-4 years. I mostly program in Java as it was my first language. I would like to be a programmer when I'm older, but I'm not sure about the differences. ...
5
votes
1answer
719 views

Attachment handling for web application with Jackrabbit

I need to manage attachments on my Spring web application and I thought to use an open source repository. My app it's a job approval system using J2EE / SPRING 3 Framework and Postgress DB to allow ...
2
votes
1answer
291 views

Push-Based Events in a Services Oriented Architecture

I have come to a point, in building a services oriented architecture (on top of Thrift), that I need to expose events and allow listeners. My initial thought was, "create an EventService" to handle ...
9
votes
6answers
5k views

Automatic source code generation — good idea or potential nightmare?

In response to my question regarding Java source code generation, I received this answer warning me about potential maintenance problems: mixing auto-generated code always pose a risk of ...
-2
votes
0answers
19 views

How to setup a good house ads system for my apps? [on hold]

As the question says What are the best methods I can use to setup such system? Are there any companies which offer house ad system?
-3
votes
1answer
43 views

Java Licenses, GPL, GNU Questions

I would like to ask a few questions about software licenses, with regards to a (Java) program I am making. I am very very new to licenses, so please bear with me. 1. If I produce a Java program using ...
-5
votes
0answers
56 views

Macbook Air for Java Programming student [on hold]

Okay so soon I am going to uni to study computer sciences and was wondering how a 11" or 13" 1.4ghz 8gb 128gb ssd would fair, I will of course be using an external HDD of about 1Tb (usb3) for mass ...
2
votes
1answer
409 views

How to translate SQL query into REST API requests?

Let's say I have a machine-readable description (such as in WADL, Swagger or RAML) of a REST API that provides interface to a database. My users submit queries about underlying database in form of ...
-2
votes
0answers
96 views

How should I structure my programming? [on hold]

I'm currently programming a game in Java and I need advice, I currently have the following setup: I'm wondering if this is the best setup for my java game? I might add that this "game" should ...
0
votes
0answers
26 views

Java API initialization step

I am developing an Android Library which involves both Network and Bluetooth communication. In order to start using the library it must be configured. In other words a request to the backend must be ...
0
votes
0answers
61 views

Separating UI from logic

I'm trying to develop a little game and for this I'd like to separate the UI from the game logic. So I'm thinking of using an "Animator" class that will be responsible for rendering the objects, but ...
0
votes
0answers
33 views

What is the best way to sort strings with multiple words in each line and is separated by newline in Java? [migrated]

I have list of anime that i have watch uptill now and i want to sort them in alphabetical order. Below is the small example of how the list is and there are over 200 lines. I have stored all of them ...
1
vote
2answers
180 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 ...
-5
votes
0answers
26 views

What sort of thing to avoid and make a habit as Enterprise Software Engineer [on hold]

Now a days , its not writing code and change frameworks and language matter the most.most. Of course , in some situation matter,but you know.Most of the time ,clients need some one with "fast coding ...
-3
votes
0answers
44 views

calling out the constructor and assigning values to it from a scanner [on hold]

I was trying to make a program that asks the user to create a person or a group of persons and assign names and age to them. So I made a constructor "Try" and a method "AskUser". In AskUser(), I use a ...
-4
votes
1answer
82 views

Should I enroll in two different programming languages for next semester? [on hold]

This semester I took Java programming and my next semester I am supposed to take the advanced Java programming class, which I will, but I was wondering if it would also be ok if I took another ...
-4
votes
0answers
51 views

I'm new to design patterns so please help [closed]

Can you guys suggest me design pattern which i can you use for shopping cart designing, requirement is to add, delete, totalcost, getall, and remove all etc should be in the fucntionality of shopping ...
-4
votes
0answers
36 views

java.lang.NullPointerException in the sunshine app [closed]

I am programming the SunShine app (The app that pushs the weather informations for your city). I have a problemme in java file called DetailActivity The problem is caused by : ...
7
votes
4answers
5k views

What's the best way to get up to speed with Java? [closed]

I'm a software developer that just switched teams so I shall write code in Java now. Last time I wrote something in the language was in programming 101 at uni (I was already an amateur coder back ...
1
vote
2answers
129 views

Ensure scheduled event only runs once a day?

In a hobby project of mine, a "smart home" for controlling lights, I'm planning to create a feature which turns off all lights at a given time of day. There are also several other features which runs ...
1
vote
1answer
149 views

How to migrate an XML serialization framework in Java in a tightly coupled system?

I work for a company that uses XML for storing a bunch of serialized Java classes. The framework we use is Apache Betwixt (abandonded in 2008) and it's kind of pain to maintain and extend (it seemed ...
-5
votes
0answers
31 views

On java with the .replace method [closed]

I am getting an error with .replace because i changed the fragments to fragmentactivity. The question is what is the equivalent of .replace for fragmentactivities or a method that can be used that ...
2
votes
1answer
66 views

Is there a limitation when using the Bloch's Builder Pattern with mandatory fields?

Background I have a class TextDrawable which draws text on top of a shape. There are a number of properties that can be set while creating a TextDrawable object. Mandatory Properties: Text Shape ...
1
vote
1answer
88 views

Best OOP pattern to use for creating a commandline SQL API for a proprietary json based company datastore

We need to create a SQL commandline tool for querying a proprietary json based datastore. I'll be using java. Any suggestions on the primary OOP design pattern I should use for building this API? ...
-4
votes
0answers
44 views

Reading 3GB+ data written along a single line in a file with exception handling [closed]

I would like to ask that if there is a file which contains data of size in GB and that data is in a single line.I am going to read that data preferably in Java program. But the point is are there any ...
0
votes
2answers
102 views

Java Multithreading and CPU cores [closed]

I have a simple question this time. If I write an java application with 4 Threads ( each thread does different work ), what will be the difference between single-core, dual core and quad core cpu ( ...
0
votes
1answer
78 views

when would you wrap a service object with an interface? [duplicate]

I'm new to UT and some of the best practices and anti-patterns when writing testable code, made me think. I used to wrap any service object with interface. but I see many mocking frameworks can ...
3
votes
3answers
293 views

Immutable objects [closed]

Looking at questions such as these If immutable objects are good, why do people keep creating mutable objects? What are the drawbacks of immutable types? At what point do immutable classes become a ...
0
votes
0answers
51 views

when would you write static method as it avoid a “seam” for testing [duplicate]

when would you write static method. I used to write it in utils classes where all the methods are static and work state-lessly on arguments only. But now I know it blocks from creating a seam in ...
0
votes
0answers
3 views

What is the reason behind this Eclipse behavior due to changing an Environment Variable? [migrated]

I have two versions of Eclipse that I use (Indigo for C++ and Helios for Java). I've used both for years without problems. Last week I needed to view Java Bytecode, so in my Environment Variables I ...
2
votes
2answers
139 views

Design - Parser.hasInfo(MyClass) vs MyClass.hasInfo()

I'm working on a document processing system. I feel confident with a Document class which represents each document being processed. The issue: Each Document can have a CoverSheet, and if it does, ...
0
votes
1answer
134 views

Ensure that a method of a class is called after every method call of the same class, how? [duplicate]

I have twenty small methods (m1, m2, m3, etc..) in a class quite different between each other, and after every method i would like to do some common actions, like increasing some counters and in the ...
8
votes
3answers
616 views

Clean Code and Hybrid Objects and Feature Envy

So I recently made some major refactorings to my code. One of the main things I tried to do was split out my classes into data objects and worker objects. This was inspired, among other things, by ...
-4
votes
0answers
46 views

How to connect android application into localhost? [closed]

Anyone? I need to know How to connect android application into localhost? Because I'm trying to connect my own made android application into localhost but it sudden, it always show message ...
1
vote
1answer
97 views

Should CountDownLatch be used for waiting for an event?

I have a situation here, where I have a loop that loops x amount of times. The value x is determined by the user. Everytime it loops, I want it to wait for a button click before continuing the loop. ...
0
votes
1answer
42 views

Custom mobile app and custom server app [duplicate]

I have this little bit simple and general question. Let's say I build an android app which requires an online server to communicate with. The thing is that I want to make the communication on my own ( ...
-2
votes
0answers
62 views

What to learn to make this java program [closed]

I'am learning java from youtube. Right now i'am halfway through at classes, objects and methods. What do i need to learn more to make a program for a shop able to make the management of the stock of ...
0
votes
2answers
135 views

2D Game Data Structure in OpenGL ES 2.0

I'm trying to come up with some data structures for rendering my map on OpenGL. It is going to be ~ 100x100 blocks(squares) total, with each block being around 100 pixels. However, the screen will ...
0
votes
1answer
302 views

Emulation of MMU accessing the contents of the registers

I'm having a play around with emulating a simple old CPU. I've set the structure up, so far anyway, as follows: The device is the main and creates an instance of the CPU. The CPU then creates ...