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

-2
votes
0answers
12 views

Hibernate : Select all record from a table for today Date

I am trying to write a Hibernate query to get all record of today date something like this public List<GroupTweetOrder> fetchTodayGroupOrder(Date date) { Session session = ...
-4
votes
0answers
63 views

“Future in programming.” Best beginner languages, education, and career? [on hold]

I am a 17 year old, High school graduate with basic understanding of some languages. Have learned some XHTML as well as some visual basic. On top of those two, ive been trying to expand my knowledge ...
-3
votes
1answer
30 views

Ruby/Rails Programming books/resources for Transitioning Java Programmers [on hold]

I am trying to transition to Ruby and I want to know which books (that are currently out as of 2014, Jun 25) would benefit a transitioning java developer like myself. Preferably an intermediate ...
-1
votes
0answers
16 views

Design consideration when sharing database between applications

I have a typical Spring/Hibernate Tomcat webapp that has a user_info table. I’m trying to create another webapp that will do CRUD actions on the user_info table. I'm considering sharing the same ...
-1
votes
0answers
20 views

Easy Web interface development framework [on hold]

So, I'm actually a DBA but a formerly Java/Python/Powerbuilder/C programmer. In the past I joined a team as developer for a large government website written in Java + Struts 1.3 + Hibernate + Sencha ...
0
votes
1answer
35 views

Implement RPC via SIP

Look at the following use case. I have a client (Java) application, which wants to get/set the state of another, remote application (C). The communication between them is done via SIP, which is run ...
17
votes
7answers
2k views

Is template “metaprogramming” in Java a good idea?

There is a source file in a rather large project with several functions that are extremely performance-sensitive (called millions of times per second). In fact, the previous maintainer decided to ...
0
votes
0answers
31 views

Overriding JDK classes [migrated]

I want to override the JDK implementation of sun.nio.ch.SocketChannelImpl so I have access to the FileDescriptor and can create a second SocketChannelImpl with an existing FileDescriptor. I can't ...
0
votes
3answers
246 views

Why do APIs generally consist of interfaces? [duplicate]

I am starting out in Java API design and in reading existing code bases, I have found that most APIs consist of interfaces only with their implementations bundled in a different package. Having read ...
-4
votes
0answers
125 views

What if I learn Java and then it becomes obsolete? [on hold]

How long do you think Java and C will be significant languages to learn? What if those languages are just not powerful enough for the new coming technological age if there is one? If this is the wrong ...
-1
votes
0answers
17 views

Develop Project on Spring framework [on hold]

I want to develop a project using Spring framework for the organisation I am working with. Can you suggest any topic or ideas for creating the same. Thanks
-2
votes
0answers
22 views

How do I program an android app that uses mobile data connection? [on hold]

I want to make an app "Call a stranger". How? It would make calls to a random app user over the mobile data connection. How do I do this? How do I make an app that uses mobile data? And, where do I ...
-1
votes
0answers
38 views

Concept to Transfer Rater per Second while downloading [migrated]

i am being given a task from my senior to come out with a function to show size transfer rate per second. I have to download a file from web with my java code and display the transfer rate per ...
20
votes
8answers
3k views

Is it an antipattern, modifying an incoming parameter?

I am programming in Java, and I always make converters sort of like this: public OtherObject MyObject2OtherObject(MyObject mo){ ... Do the conversion return otherObject; } At the new ...
2
votes
4answers
239 views

Is it possible to have a single code base for a desktop GUI and a web application?

The required user interface is fairly simple; basically, two tables that "interact with each other", e.g. certain rows in one table get highlighted when a row in the other is clicked, plus maybe a ...
3
votes
2answers
204 views

Is the Java Integer cache a realization of the object pool pattern?

One of the best-known examples of a full-fledged object pool is the JDBC connection pool. Main reasons: objects in the pool are expensive to create and relate with external resources each object in ...
2
votes
3answers
197 views

Transitioning from Java & C to C++

I learned Java and I'm pretty competent programming in it. I also learned C recently. I looked at a comparison between Java and C++ and I like C++'s features like operator overloading and its speed. ...
0
votes
1answer
58 views

How can I use guice to replace code dependent on service locator implementation?

Consider I have a service called FileSystem, and that this FileSystem is used by various classes throughout the application. Typically, the service is acquired via some static class method ...
3
votes
1answer
69 views

Defining a random “safe” path for a game character

I am writing a game in Java and it can be likened to the recently popular game "Flappy Bird" in the sense that the character moves up and down and the users touch and must avoid the obstacles. The ...
-6
votes
0answers
31 views

JAVA methods that return data [on hold]

Can someone explain me all about methods that return data or send me link to some good tutorial about it,like what type of data they return,where they return it and how it works exemple public String ...
1
vote
4answers
160 views

How to ideally calculate profit margin with zero sales

How do you handle the following scenario without null? You have this problem (In Java): BigDecimal sales = ...; BigDecimal cost = ...; BigDecimal profit = sales.subtract(cost); // Profit Margin = ...
0
votes
0answers
37 views

Dynamically add/remove components to/from panel

I'm in a little planning phase of my java/swing project. Here is a picture: It is a main panel containing several sub panels depending on the selected date in the top center. I want to browse those ...
0
votes
0answers
20 views

Broadcast receiver Or Services

I am creating an "Alarm Clock" app in Android. I learned that we can implement OnReciever() method and write those things which we want the alarm to do after an intent is fired. But I have now come ...
-1
votes
0answers
40 views

Web App With Neural Networks [on hold]

I'am planning to write a web app project that that depends on series of Neural Networks. So performance is a big factor for me to choose the language. Using Core C and Python-Django interface is a ...
0
votes
0answers
109 views

Complexity of ArrayList of LinkedHashSet

I get input strings from the console like this: while ((currentLine = bufferedReader.readLine()) != null ) { StringTokenizer string = new StringTokenizer(currentLine, " "); while ...
0
votes
1answer
113 views

problem on calculating Big O complexity

i have this function on which i have to calculate the time complexity with the Big O notation: public void print(ArrayList<String> operations, ArrayList<LinkedHashSet<String>> ...
-1
votes
0answers
18 views

Struts forms still empty [migrated]

I am beginner developer and i'm working on a web application in Java whith struts. I have a problem with my struts form which stay empty after user enters informations. I've tried many way to resolve ...
0
votes
3answers
91 views

How to get an image or rectangle to detect collision with another image

Can someone please explain to me how to detect collision with another image? The tutorial I was watching explained how to detect if a collision occurs between two rectangles but I would like to use ...
2
votes
1answer
137 views

Working with a large, messy object [duplicate]

I have been handed a very cluttered, "One Ring" object (one object to rule them all). The OR class has 40 fields. These fields map to 16 different objects (the OR has all the fields from the 16 ...
38
votes
5answers
6k views

Why was C# made with “new” and “virtual+override” keywords unlike Java?

In Java there are no virtual, new, override keywords for method definition. So the working of a method is easy to understand. Cause if DerivedClass extends BaseClass and has a method with same name ...
-2
votes
1answer
77 views

What is the best way to get a method name in runtime?

Here is a little background of my problem: I implemented a singleton logger class which is being called from several projects. I want to log the name of the class as well as the name of the method ...
-2
votes
4answers
209 views

What is the name of this design pattern? [closed]

I have been using this "design pattern" (may or may not be an "official" design pattern) for a while and I wanted to know if it had a name (so that I could name my classes after it). Example in PHP ...
0
votes
2answers
82 views

calculate complexity of LinkedHashSet

I have an ArrayList<LinkedHashSet<String>> setOfStrings for example this arraylist internally is composed like: positionX[hello,car,three,hotel,beach] positionY[.....] ... I want to ...
0
votes
2answers
65 views

Rectangle class java.lang.Object

Can someone please explain to me the difference or benefits rather to using the rectangle class ex. Rectangle r1 = new Rectangle(x,y,w,h); versus the graphics class drawRec method? ...
-4
votes
0answers
50 views

Who are some inspirational figures in the Java community? [closed]

While digging around the web I've seen a lot of great learning material for languages like C#, Python, and Ruby. The community for these languages appear to be growing and from my personal experience ...
0
votes
0answers
10 views

How to get Datasource JNDI access to work with WebLogic reliably (no NameNotFoundException)?

in a WebLogic web application (bundled and deployed as a Jar) I sometimes get a NameNotFoundException when I try to fetch a datasource using JNDI lookup. The datasource is not shown in the JNDI tree ...
-3
votes
0answers
31 views

certification are necessary for employability [closed]

I am doing my Final year in computer science and engineering and good at programming.For placement, whether certifications play a main role. Whether employ-ability increases by having certification.
-1
votes
1answer
37 views

Swing component name suggestion for a specific interface [closed]

As a university project, I have to replicate Raptor. A flowchart interpreter. The interface looks like this But as I am not a experienced swing developer, I don't have much idea about which swing ...
2
votes
2answers
138 views

Is it better to draw my own graphics or import images?

I am about to start a Tetris clone using Java as my programming language. While I was designing how it'd be done, I've stumbled upon this question: What would be better, if any difference at all, ...
0
votes
0answers
4 views

js syntax errors in text adventure [migrated]

hi i'm new to java script and I wrote a text adventure for a school project and I keep getting these error when I try to run it js: "adventure.js", line 4: missing ( before condition js: if var ...
-3
votes
1answer
132 views

Can I use BOTH Java and C# in a game/application? [closed]

I am attempting to create something with friends, just a bit of debate over which language to use. This is not a debate over which is better, but can I use both in one application. And if so, how hard ...
-1
votes
0answers
25 views

android socket readObject EOFException [migrated]

In Android I make a siglenton pattern and when a send object the readObject the shows me the messaage: W/System.err(6034): Exception reading Streams: java.io.EOFException but when I put String I ...
6
votes
6answers
412 views

How to avoid downcasting?

My question is about a special case of the super class Animal. 1. My Animal can moveForward() and eat(). 2. Seal extends Animal. 3. Dog extends Animal. 4. And there's a special creature that also ...
0
votes
1answer
42 views

Sortable listview using SQLite [closed]

I'm implementing a sortable listview using bauerca's library here. This works, but now I need to define some things where I need some help. This is the functionality of my app_ I can create up to 5 ...
2
votes
0answers
221 views

Is it safe to convert Windows file paths to Unix file paths with a simple replace?

So for example say I had it so that all of my files will be transferred from a windows machine to a unix machine as such: C:\test\myFile.txt to {somewhere}/test/myFile.txt (drive letter is irrelevant ...
-3
votes
0answers
39 views

Debuging Android Application in Eclipse [closed]

I am New to Andriod Java.. My Team Lead Has Given Me One Android Application.He told me to ?Understand me the Code..And Code Flow.. I dont have any Code Documents or Sequence to understand the ...
-5
votes
0answers
85 views

How to become expert in JAVA [closed]

I have 10 years of exp in software dev. I have worked on many tech like C, C++, Lotus Notes, C#, ASP, VB, java script, VB scripts, Perl, shell, RDBMS tech, report tech, and various others. Though I ...
0
votes
0answers
53 views

Convert string with commas to double number in spring MVC [closed]

I am currently using MappingJacksonHttpMessageConverter in my Dispatcher-Servlet.xml. In my application when the user enters a currency, commas are itself attached to the value. When that value is ...
6
votes
3answers
365 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% ...
3
votes
2answers
234 views

I don't know how to understand the Wildcard type in Java

I am reading the Core Java (9th edition) by Cay S. Horstmann and Gary Cornell. After making an effort, I cannot still understand the ? super Manager. Here are some materials relating to this question. ...