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

-5
votes
0answers
20 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
1answer
48 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 ...
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
26 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
10 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
55 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. ...
41
votes
5answers
4k 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
45 views

Why use logstash with elasticsearch? Any advantage

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

Java - Get Interface Generic Type

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
23 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
136 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
22 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
43 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 [on hold]

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
52 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
210 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? [on hold]

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
42 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 ...
8
votes
4answers
559 views

What complexity do DI frameworks add?

The currently most upvoted answer to a very recent question states that DI containers are an "enterprise software" pattern, used when the object graph is very large and complex. I suspect that 95% ...
1
vote
1answer
169 views

Adding a graphical view to a system

I currently have an program in Java that simulates railway movements. Essentially, trains arrive on platforms, pick up and drop off passengers, and then proceed, respecting signalling where possible. ...
-2
votes
0answers
21 views

create an association in the Default Programs control panel [closed]

I make a rar application.exe in netbeans , and I put it in context menu using regedit (shell) , when i click on it in context menu this message appear : "this file does not have associated with it for ...
-4
votes
0answers
39 views

GUI and the logic [closed]

DISCLAIMER:- The following example is highly scaled downed version of what I am trying to do in reality. Overview: • Application name: Random number generator. • Desired application flow: The ...
0
votes
0answers
80 views

Java server side : Is this a good design/layered approach?

We are in the process of designing an application using AngularJS, RESTful service (Jersey) and JPA for CRUD operations.The RESTful layer might call other external services to get data. There could be ...
0
votes
1answer
89 views

Using XML to store and edit data records in Java

I want to use XML to store data for an assignment . In this Java assignment I'll get data from the user in form of lines in a file below INSERT INTO student(id,name,family,isMale) VALUES ...
45
votes
10answers
15k views

Why is String immutable in Java?

I couldn't understand the reason of it. I always use String class like other developers, but when I modify the value of it, I need to create new instance of String. What might be the reason of ...