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
2answers
591 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
0answers
31 views

Simple encryption using key [on hold]

I want to encrypt the contents of a .txt file using NetBeans. This would involve reading the file, changing the characters and writing to another file. However, I want to achieve the encryption using ...
0
votes
1answer
31 views

Where to go after learning basic Java? - Objects First With Java [on hold]

So I've taken a basic college course in Java. Before this I was completely knew to programming, but was always and still am eager to learn it. We used the book Objects First With Java, 5th Edition, ...
-1
votes
1answer
80 views

What are the benefits of using coding? [on hold]

I am completely new to coding java... and I was asked to give a small presentation about coding. I just would like to ask why is coding good? I know I could search it on the internet but so far i ...
0
votes
1answer
41 views

How do you name the Visitor implementation? [on hold]

I was reading about Visitor pattern and was a little wondering about naming of the methods. Assume we have the implementation of the pattern as follows: public interface Entity{ public void ...
1
vote
2answers
66 views

Split one big class on sub-classes

I have a generic question and I don't understand how create what I want. I writing a basic program they can access to one database an do some SQL request, etc. But at the moment I have one big class ...
-2
votes
0answers
42 views

How to become Java developer.()() [on hold]

HI im very very interested in java. I want to become a java developer. I cant join any institution because of my financial problems. Help me how i can become a java developer and what subjects should ...
0
votes
1answer
93 views

Elegant way to count the number of files in Zip archive

I need to count the number of files in several zip archives for error checking. I've found several answers on SO but nothing elegant. I currently have the following code which works but it's not ...
-5
votes
0answers
33 views

C and Java Programmar [on hold]

I am currently pursuing computer science in college. 1)I want to be a professional C and Java J2SE Developer...(not only a programmar)...so that I can develop system softwares,customize linux shell ...
0
votes
5answers
2k views

Why is no default constructor generated if you define an explicit constructor?

class Employee{ String name; int id; //No explicit constructors } Now i can invoke the following statement Employee e1=new Employee(); Now the compiler( i'am not sure about who ...
17
votes
3answers
1k views

Java and .NET: Why different sorting algorithms are used by default?

Just wondering why Java and .NET Framework uses different sorting algorithm by default. In Java Array.Sort() uses Merge Sort algorithm by default and as Wikipedia.com says: In Java, the ...
-2
votes
0answers
28 views

WebService in Java - why code does not execute? [on hold]

Here is my sample code. It does barcodes scanning. Function sendJson should call webService. Code runs but in Apache log I see NOTHING. For some reason web service is not called. What I'm doing wrong? ...
1
vote
0answers
11 views

How to loop through array bidimensional in diagonal according to a position in degrees

The title could be no self-explanatory enough but I need some conceptual help in order to implement a solution to go through an array: I'm developing a program to calculate the "most shadepath" route ...
1
vote
2answers
30 views

Testing code in Java that is only loosely defined

My question is about testing in general. At school, professors say that testing has to be written before we begin to write some code. I guess we need to use EasyMock to represent the classes not ...
-4
votes
0answers
64 views

What do you think about a CMS similar to WordPress but implemented in Java? [on hold]

I am a Java developer and I am also interestest in WordPress CMS (it is a very popular PHP product, I think that all know it) website development. In this time I am working in Java on LifeRay webapp. ...
49
votes
5answers
5k views

What exactly makes the Haskell type system so revered (vs say, Java)?

I'm starting to learn Haskell. I'm very new it and am just reading through a couple of the online books to get my head around its basic constructs. One of the 'memes' that people familiar with it ...
0
votes
0answers
50 views

Why use logstash with elasticsearch? Any advantage [on hold]

Recently i am working on generating a report using kibana and elasticsearch. Is there any advantage of using logstash to send data to elasticsearch over sending it directly? Gone through a few blogs ...
1
vote
2answers
69 views

best practices for packaging in Scala projects?

Scala runs on the JVM, but that doesn't mean we have to write it like Java. Eclipse discourages use of the default package. What are some considerations (e.g. size of project) that determine how ...
0
votes
1answer
227 views

Java - Get Interface Generic Type [on hold]

I'm trying to create an Interface with Generics which allows me to get the type of object in the generics but no matter what I try there's a syntax error. I've tried the following 3 methods. All of ...
-3
votes
0answers
51 views

Has anybody found a way around new Java applet security in local area networks? [on hold]

I have an M2M network within a local area set of IP addresses (192.168.xxx.xxx) and I cannot let users access anything within, except through a browser. For that I need an applet and now I find all ...
-2
votes
0answers
32 views

Java Ascii Table [on hold]

so I'm having trouble creating a table that is used for a game. It needs to have 3 Human charaters (@), 2 Monsters (#), 3 Treasure Chests (*) and 4 Obstacles (O). The table needs to be 10 by 10 ...
2
votes
4answers
247 views

“One of some”-type

Say that you have some different classes that does not really have any functionality in common, but somewhere in your program, you need one of them (which one is not necessarily important) because ...
12
votes
2answers
1k views

Java and JVM license

Does Java license allow other companies to create their own versions of Java language or just implement it accurately? Same question about JVM. I heard about Sun suing Microsoft for changing their ...
4
votes
2answers
8k views

Which arguments pass by value and which pass by reference in Java?

I am starting to learn Java with the Java Trails tutorials offered by Oracle. I am in the section where it talks about passing arguments to methods ...
0
votes
1answer
59 views

Converting from byte[ ] to user defined type

I am working on a network simulator designed in java with the basic function of routing messages through a network. I am trying to take a Message object, encrypt it using an encryption utility that ...
0
votes
0answers
25 views

Can't figure out how to parallelize the calculation of the amount of offspring expected for species in genetic algorithm

I developed a genetic algorithm in java 8 taking advantage of its reasonably free parallelism opportunities with Streams. As you are likely aware, running the epochs takes its time for even a test ...
1
vote
1answer
65 views

Internationalization on a service layer of an application

My specific problem is how to handle internationalization of specific messages from an architecture layer that is not the view layer(e.g service layer). I've created an architecture based on ...
-2
votes
0answers
25 views

Fix java.lang.NullPointerException? .setColor(c) [on hold]

Code: JPanel randomPreview; {..} **66-70** public void showPreview(int pX, int pY, int pCol, JPanel pPanel) { Graphics g = pPanel.getGraphics(); Color c = new Color(pCol, pCol, pCol); ...
-5
votes
0answers
24 views

Logical error help [on hold]

Sorry for the title, I'e been trying to get this program working for a while and it really beats me as to why I can't seem to get it work as I want so here's my whole code: import java.util.Scanner; ...
-2
votes
0answers
143 views

Why do C based languages use a colon for the case's? [on hold]

Why is a colon used at all? For example: switch( c ) { case 'A': CapitalA++; case 'a': SmallA++; default : total++; } Instead of: switch (c) case 'A' ...
0
votes
0answers
123 views

How to web scrape [on hold]

So I am using a raspberry Pi for displaying calls to our fire department on a big screen. It works great but I want to customize the display. Currently, it takes the information from a webpage that is ...
-2
votes
0answers
16 views

JComboBox to auto suggest in java se [migrated]

I want to know how to get an JComboBox to auto suggest the elements when we type in the combo box. For an example, If I had loaded a JComboBox with these names using MySQL, [Amila, Nimila, Nikila, ...
-3
votes
0answers
8 views

I am getting org.hibernte.InvalidMappingException: unable to read xml when i try to run my program [migrated]

I am a beginner to Hibernate and cannot understand in which part of my program I have made an error. Can anyone please tell what may cause this type of error : org.hibernte.InvalidMappingException: ...
-3
votes
0answers
23 views

Which platform i can use to develop a VNC server between JCreator, Net Beans and Eclipse? [on hold]

I would like the develop a VNC server that will allow the remote connection of two computers located in different locations and connected in different networks.
-1
votes
1answer
59 views

Withdrawal and bank balance in banking system [on hold]

I am making an online banking system(codes can be provided if necessary), my problem is with getting the balance of an account and withdrawal. How can i design this into the system, I can allow the ...
-2
votes
0answers
44 views

How to make java games [on hold]

hi I am a student in IT (Multimedia Programming). I am new here in this website and really I like it very much . my question is ( I will make game about hidden objects by using (java eclipse) , so I ...
0
votes
1answer
182 views

Dealing with several custom getters

I have a data structure with data units containing different types of data. I've wrapped the data in "Field" objects so that each field is able to independently parse user input in a desired way. ...
1
vote
1answer
90 views

How can I find what Resources a Java EE container provides?

How can I find what "Resources" a Java EE container provides? Can I discover this programmatically, or is there documentation I should refer to? (Note that the Java EE tutorial is vague on this ...
0
votes
1answer
29 views

How do I effectively test, and log, network status with a Java Application?

I want to write an application (in Java) that basically detects when I lose my internet connection, and then log the time. To make things more challenging, I'd like to figure out the point of failure. ...
1
vote
3answers
112 views

Best approach to implement an update operation of a container object?

I have an Invoice object wich may contain several FacturedServices objects stord as a list. In may interface, the user can edit an Invoice object, delete add or edit its FacturedServices list. Whe ...
-4
votes
0answers
18 views

Confused to select the domain [closed]

Everyone please suggest me what to do for my following questions: 1. I have done course in java and know basic fundamentals, unfortunately i have not yet get an opportunity in java. So should i wait ...
1
vote
0answers
53 views

Finding the closest n points to any arbitrary point in two dimensions (r-tree, quadtree, spatial index)

I have a distribution of two dimensional point objects. How is it possible to find the nearest N number of points to any given point without iterating over the entire collection of points (and only ...
3
votes
2answers
880 views

“Clean Code”: How to organize named queries?

Few days ago I started to read Robert C. Martin "Clean Code" book and it encouraged me to look more detailed at my code. After I opened eclipse I saw this: ...
2
votes
1answer
211 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 ...
0
votes
1answer
60 views

Serialization - can the output from a serializer be modified and then de-serialized

I am trying to serialize a Message object using ObjectOutputStream ,take the byte[ ] output of the serializer,encrypt it using an encryption tool and then trying to de-serialize it and cast it as an ...
-3
votes
0answers
42 views

am i ready to develop for android? [closed]

hey guys i've been studying java a lot recently so i can design my app and i want to know if my knowledge so far will suffice? i'm far familiar w/ the basics (data types, conventions, etc...) i'm ...
-2
votes
0answers
53 views

How to map the API Version in the JAVA Source code? [closed]

I am using Restlet FrameWork. I can able to pass the version in the Rest API as a header. Example : http://localhost:8080/example.com/ping In header: Version : 1 And I received in my code using ...
-2
votes
0answers
18 views

SOAPHeaderElement removeNamespaceDeclaration [closed]

How I can remove namespace from header . <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" ...
0
votes
0answers
14 views

Arrow pointing towards location in conjunction with distance from location [closed]

I'm currently writing an Android Application in Eclipse in which I need to direct the user from their current point to another point (determined by an algorithm). In order to do this I'm using an ...
0
votes
0answers
43 views

Materializing Java Swing JComboBox [closed]

Java Swing was developed in late 90s, since then UI design has come a long way. Now, Material Design is all over the place. I am curious, can Java Swing components be materialized according to Google ...