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

-4
votes
0answers
22 views

Finding the Longest Palindrome string from the first alphabets of random student names? [on hold]

I have a problem in which I have a set of student names For example:A small set {'Alex','Boris','Zing','Nix','Chris'} etc. The first characters will be A,B,Z,N and C And the string generated by it ...
7
votes
4answers
535 views

Why does the TRACE level exists, and when should I use it rather than debug?

In Log4J, Slf4J and a couple other logging frameworks in Java, you have two "developper" level for logging. DEBUG TRACE I understand what DEBUG do, because the explanation is clear. The ...
-3
votes
0answers
45 views

programming help [on hold]

I am a young student in college trying to learn how to code, i was wondering if you guys can give me some tips and maybe some helpful resources that would be greatly appreciated
0
votes
3answers
149 views

Why does an interface extend an interface instead of implementing it?

In Java suppose that I have interface A: public interface A { // foo } I also have interface B: public interface B extends A { // foo + bar } Why does interface B extend interface A ...
-1
votes
1answer
46 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, ...
0
votes
1answer
54 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 ...
-2
votes
0answers
56 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 ...
1
vote
2answers
80 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 ...
-6
votes
0answers
40 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
109 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 ...
-2
votes
0answers
30 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? ...
-4
votes
0answers
69 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. ...
0
votes
0answers
53 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
70 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 ...
-3
votes
0answers
52 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 ...
1
vote
0answers
15 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 ...
51
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 ...
-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 ...
0
votes
1answer
60 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 ...
2
votes
1answer
67 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
26 views

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

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

Logical error help [closed]

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

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

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' ...
-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: ...
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 ...
-3
votes
0answers
23 views

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

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

Withdrawal and bank balance in banking system [closed]

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

How to make java games [closed]

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
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. ...
-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
60 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 ...
0
votes
1answer
61 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
43 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 ...
1
vote
1answer
91 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
0answers
15 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
44 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 ...
2
votes
3answers
257 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 ...
0
votes
0answers
85 views

Java server side : Is this a good design/layered approach? [on hold]

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

Is this code Clean, Effective and SOLID? [migrated]

I've recently read the books Clean Code and Effective Java. I am a huge fan of Object-Oriented Java. I am trying to write as professionally as possible. I have been an Android Developer for 20 months ...
1
vote
2answers
33 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 ...
2
votes
1answer
91 views

Is it OK to deprecate methods that need to be public due to the packaging model but are not to be used outside the codebase in Java?

I am currently working on a semi-large project that has several packages. There are 3 main packages, a "client" package, a "server" package and a "common" package. There are two jars, one for the ...
5
votes
3answers
182 views

Is it conventional to name final/constant local variables in UPPER_SNAKE_CASE?

Pretty simple, I have a method: public final void myMethod(User user, Group group) { final int MAX_USERS_PER_GROUP = group.getMaxUsersPerGroup(); int usersInGroup = 0; // Get users in ...
3
votes
1answer
130 views

Recursively parse without resorting to ugly design patterns

I'm currently building a crochet pattern parser in Java, and I've hit upon some trouble. I'll call the language used for input Crochet Pattern Code (CPC). I have a rather large writeup on the ...
2
votes
0answers
63 views

Fixing years of bad coding [duplicate]

Last year I got my first job with an I.T. company developing industrial Android applications. Unfortunately, when I got there and started working with the code base I was repeatedly confronted with ...
-5
votes
0answers
66 views

Breaking out of an for statement in Java [migrated]

If i do something like this boolean ret; for(int i = 2;i<30;i++) { if ( 30%i == 0){ ret = true; } else { ret = false; } } ret becomes true allready at 2, but also at 5,10 15, is ...
2
votes
2answers
67 views

Creating an auto-patching system for Spring Hibernate Application

I have this question for few months now. We have a web application which has monthly changes and weekly bug fixes if any. Usually we just build the new war, undeploy the old ones and redeploy new ...
6
votes
6answers
566 views

Why are my unit tests so expensive? [duplicate]

I am a Java developer, working on a small project. We are three people in the team, we have a budget for 3 months of coding (+ some time for the Analyst, Project Manager and QA team). It is a small ...