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

-3
votes
0answers
17 views

Java display problem (android project school)

My first app is a register app where user can get registred into a mysql database and can also get connected. One connected my app display a welcome page. My second app is a gps tracker, that have ...
-1
votes
1answer
48 views

Shall one return a manipulated List for better readability?

The code below shows that lists (in Java) which will be manipulated in a function will be manipulated in the main code block, too. But e.g. Strings won't. One will need to return the manipulated ...
0
votes
0answers
15 views

Debugging xml and annotations

By now, most web containers have an annotation variant of their xml configurations for Java EE. I'm guessing this is because it's better to keep things in Java where they can be managed, coded with ...
-1
votes
0answers
26 views

Sum of Digits in Java using only beginner stuff [on hold]

I am trying to find the sum of digits in a factorial. For instance, the output I get is a=531; what I want to find is the result 5+3+1=9. However, I can only use for loop, I am not allowed to use ...
-2
votes
0answers
47 views

How to control a Java program interactively via buttons in a GUI? [on hold]

I have an application to which I need to provide a GUI that exhibits the current state of a handful of items (custom objects) that are pretty much the core of such application. However, since the ...
0
votes
0answers
4 views

Programming in Debug context in Eclipse IDE [migrated]

Is there a way to program (Java), I mean, write some piece of code anywhere in IDE, to evaluate something in the current debug context when the program execution is waiting on some debug point in an ...
0
votes
1answer
131 views

How to spawn multiple “monsters” from a single class [on hold]

How to spawn multiple "monsters" from a single class? Can store it in an array, ok, but later on, how can I paint it? Because if I do: enemy = new Enemy(); enemy2 = new Enemy(); I create two ...
17
votes
7answers
1k views

What can one do to improve readability of math-oriented code in C#, Java, and similar? [on hold]

As both a C programmer and a C# programmer, one of the things I don't like about C# is how verbose math functions are. Every time you would have to use a Sin, cosine, or power function for example, ...
0
votes
1answer
121 views

Best practices for developing desktop application for Windows and Linux? [on hold]

I have to provide a small application that should be run on both Windows and Linux \UNIX. A desktop application. It should provide one screen and a few buttons on it. It should run some commands in ...
0
votes
1answer
93 views
+200

Pluggable UI Components in Java Web Applications

I will try to explain my question with an example. Let us say that we are writing a hotel reservation system which is web based using Java. We will have different payment methods, say Paypal, Master ...
-2
votes
0answers
47 views

Potholes in a multiplayer snake where players can use their own algorithms

I'm developing a snake-like multiplayer where players can use their own algorithms to determine the next move of their snake. A little background: My game searches a folder for any compatible .jar ...
-3
votes
0answers
52 views

Guidelines for developing SAAS applications in java [on hold]

Are there any guidelines which assist in building SAAS applications ? Just to gain experience, I want to build a SAAS application. Say a library system. Other than knowing that the basic approach ...
1
vote
3answers
173 views

Implements > extends, but what about variables?

It's preferable to write programs that depend on interfaces rather than on superclasses, but what when you want a class to have certain variables? Sometimes you want a class to implement a certain ...
-3
votes
0answers
34 views

OCPJP questions with answers [on hold]

Can you guys give me some links which have OCJPJ questions with answers ? I am new to OCPJP and I iike to enhance my knowledge. I Hope I can learn more through doing questions and answering them. I ...
0
votes
2answers
117 views

Should I have an object as attribute or primitive id?

I am wondering which principle should I use. Here is my situation. I have a class named TravelOffer. This class looks like this: public class TravelOffer { private final long id; private ...
1
vote
1answer
77 views

Best approach to a defined datastructure

I have a plain text file with some data that I can't change, so I have to create a datastructure to use in reading the file and with that datastructure do some thousands of interactions. The file ...
-1
votes
1answer
46 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
2answers
230 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) ...
-6
votes
0answers
47 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 ...
2
votes
1answer
126 views

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

I have a lot of confusion about Java's 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, ...
-2
votes
0answers
65 views

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

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
2answers
71 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 ...
1
vote
4answers
360 views

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

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. ...
-2
votes
0answers
20 views

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

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

Macbook Air for Java Programming student [closed]

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

How should I structure my programming? [closed]

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
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 ...
0
votes
1answer
89 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
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 ...
-5
votes
0answers
27 views

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

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 [closed]

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

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

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
52 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
38 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 : ...
1
vote
2answers
130 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 ...
-5
votes
0answers
32 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
69 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
90 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? ...
0
votes
1answer
81 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 ...
0
votes
0answers
53 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
2answers
106 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 ( ...
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
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 ...
0
votes
1answer
136 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 ...
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
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 ( ...
0
votes
3answers
115 views

At what level of abstraction are data structured created?

I am learning about Linked List and Arrays in my data structures class. We are make them in Java. Are actual data structures designed in Java/C? Or are they made in lower level languages like ...
0
votes
3answers
144 views

How can DB and UI agree on default values?

I created a table in a Postgres database. I would like to create a form in a Java application to insert rows into that table. Certain fields have default values. What is the best way for the database ...