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

Searching a large file in Hadoop

I am new to Hadoop/Map Reduce and am thinking of solving the following problem: I have two files viz., f1 and f2. The file f1 is small (a few thousand records) and the file f2 is large (a few million ...
-2
votes
2answers
56 views

What are the difference between push() vs add() methods in Java Stack? [on hold]

What are the difference between push() vs add() methods in java Stack? please explain little bit?
0
votes
0answers
75 views

A new i/o library: a good idea or a really bad one?

For a long time I worked almost exclusively with input/output streams in java. However a few years ago I started exploring async I/O as well (e.g. running on jboss netty). However when working in the ...
-1
votes
1answer
125 views

Why is it considered a bad idea to compile a Java app natively? [duplicate]

There are native Java compilers in existence. They compile Java source code to native binary. However, they are rarely used and it is generally considered a bad idea to use one. Why so? The only ...
-1
votes
2answers
100 views

Is it possible to implement a native compiler for a 'managed language' such as Java?

In most cases, it is possible to create both a native compiler and an interpreter for a programming language. The compiler would simply convert the source code to machine code, and the interpreter ...
-3
votes
0answers
17 views

In my project after registration the data is storing in mysql but the success page is not coming, [on hold]

In my project after registration the data is storing in mysql but the success page is not coming, <%@ page import="java.io.*,java.sql.*"%> <jsp:useBean id="db" class="Online.DbExam"/> ...
0
votes
0answers
16 views

URL and Controller structure for parent-child-relationship

I use an MVC web framework to create an application which contains a hierarchy: Location <1-N> Devices <N-M> Services I have a number of Locations. Each Locations can have several ...
1
vote
0answers
47 views

Why has JDBC chose to avoid named parameters? [on hold]

The need for this seems obvious. While I can only speak for PHP, the existence of PDO should be sufficient to show it is possible to do in Java. I know Spring JDBC has named parameters, but it seems ...
0
votes
1answer
50 views

Code & Review standard; Soliciting Input [on hold]

I am tasked to write a Java code and review standard for a small development team. The team consists of two senior and two junior developers (I am one of the junior developers) and an Analyst. It is ...
-3
votes
0answers
23 views

I am using VM, I want launch the applet viewer, but I am unable to launch it [on hold]

I am using VM, I want launch the applet viewer, but I am unable to launch it. So can you please give me your valuable suggestions, how to launch the applet viewer in VM. I am waiting for your ...
2
votes
1answer
78 views

Java Communcation API not available for Windows

I want to write a program in Java using RS-232. But I am unable to find the java.comm Package for the windows. Which library should I use for this purpose? ...
0
votes
3answers
210 views

Understanding object-oriented programming: why is it important? [duplicate]

Just started learning about classes in C++ and I'm have trouble understanding why object orientated programming (OOP) is useful. I understand the syntax, how to use them etc. But I'm still confused ...
-3
votes
0answers
81 views

Java: What exactly to do with it [on hold]

I'm currently a Freshman (soon to be Sophomore) in High School. I started programming about 3 years ago and I've really only gotten as far as learning HTML, CSS, JavaScript, basic PHP, and basic SQL. ...
0
votes
0answers
25 views

Spring bean injection into a hibernate validator constraint

I have a controller method like listed below whose argument is annotated with @Valid to validate PasswordChange object using a Hibernate validator @Constraint. Both PasswordChange and a sample ...
-2
votes
0answers
54 views

How to start searching for job abroad [on hold]

Sorry if this is too OT, not sure on which StackExchange site to post it on. I want to start searching for a job abroad, specifically in the UK (me being from Romania). I'm a Java EE programmer. I ...
0
votes
0answers
25 views

Specific class to pass a bundle of data from my Model to Controller or a simple Collection?

I am doing an Invoice application implementing MVC pattern design in Java. One of the features my application has to have is showing all info about a Customer: Personal data, Calls, Invoices, ...
-3
votes
0answers
95 views

Ages between 18-24, if statement [migrated]

I'm a beginner and I'm doing all the Java exercises on programmingbydoing. I get errors in my code cause I don't know what "symbol" or structure I'm supposed to be using. else if ( age == 18 || 19 || ...
0
votes
0answers
53 views

Designing a backup system? [on hold]

I'm creating a program that allows you to backup/restore data on an iPhone/iPod Touch/etc. without the need to boot it up. The problem is that I need an effective and efficient way to store these ...
-2
votes
0answers
21 views

Program which will encode the text with set of numbers and decode the same text using Maps in JAVA [on hold]

I want to write a simple program which will encode a text with set of random generated numbers and then it will decoded. I want to use Maps for it but I don't have any idea how start with. Can you ...
0
votes
1answer
80 views

Java Singleton fields implementation

I have singleton in Java and I have realized, that I could make its fields static and it would work same way as regular instance fields. Would there be a performance / optimization difference? If ...
-1
votes
0answers
32 views

Best Practice to store KEY-VALUE pairs in JAVA [on hold]

I want to store following data for comparison in Code Cardinal Direction Degree Direction N 348.75 - 11.25 NNE 11.25 - 33.75 NE 33.75 - 56.25 ENE ...
-2
votes
0answers
34 views

Capturing client request headers (complete) along with IP address information? [closed]

I want to write client request to a file with two things/information headers ip address The code I'm testing on free hosting service.Code is <? $headers= apache_request_headers(); foreach ...
-3
votes
0answers
24 views

CMS-based ecommerce/delivery site [closed]

Is it secured to create a Wordpress-based CMS site catered to ecommerce, would you recommend any CMS that can fulfill this task? e.g Joomla, Drupal. Should I just pay someone to create this ...
0
votes
2answers
45 views

Can I use a package visible constructor for creation?

I need a class where this can be done: // user program elder_tales.Player p = elder_tales.generate_player(); elder_tales.level_up_player( p ); but not: // user program elder_tales.Player p = new ...
1
vote
2answers
283 views

Just one class - Java

I've written a program in Java, it's only fairly small and I started programming and ended up just building one big class with everything inside it. The program works fine and exactly how I wanted it ...
18
votes
5answers
3k views

How would another popular language avoid having to use the factory pattern while managing similar complexity as in Java/Java EE?

Factory pattern (or at least the use of FactoryFactory..) is the butt of many jokes, like here. Apart from having verbose and "creative" names like ...
0
votes
0answers
111 views

How can I re-use object from another project?

I have a first project has a feature to viewing, inserting and updating an employee record, with this possibly I will create a java class for the UI and another for the database connection with ...
-4
votes
0answers
80 views

What to do when confused on game programming [closed]

I spend needless hours trying to understand but fail. I've tried on my own which helped but then I learned about game loop and such. is there a good youtube tutorial online that is best to follow? I ...
2
votes
3answers
234 views

Inheritance: Is code from superclass virtually *copied* to subclass, or is it *referred-to by subclass*?

Class Sub is a subclass of class Sup. What does that mean practically? Or in other words, what is the practical meaning of "inheritance"? Option 1: The code from Sup is virtually copied to Sub. (as ...
-1
votes
3answers
171 views

Finding the name of a video game with a picture of its cover (Python/Java) [closed]

For the past few days, I've been trying to figure out how to take an image of a video game cover (like this one) and get the name of the game from it. Initially I attempted to use Google's Search by ...
0
votes
0answers
28 views

Realtime data transport architecture [closed]

my first post here, so be gentle. <3 I have a concept of a game system that includes (preferably) Java server and multi-platform clients (Web, Android, iOS). This is a 1vs1 player-vs-player ...
2
votes
2answers
113 views

Design Hash table with simple hash function

I want to learn to Design Hash table with simple hash function for better understanding. I understand that the hash table will work as long as the hash function maps each key to a non-negative integer ...
0
votes
0answers
56 views

2D Game Data Structure in OpenGL ES 2.0

I'm trying to come up with some data structures for rendering my map on OpenGL. It is going to be ~ 100x100 blocks(squares) total, with each block being around 100 pixels. However, the screen will ...
4
votes
3answers
477 views

What is the process of determining which method in a class hierarchy should execute known as?

I thought I understood inheritance and polymorphism, but I was given this question, and I can't, for the life of me, figure out what the proper answer is or what they're trying to get at: The ...
-3
votes
0answers
99 views

Switch career from Java to big data - confused :/ [closed]

I need some information to take a decision which matters a lot to me. I know this is a bit lengthy and I request you to read through it. Currently I am working as an application developer with the ...
0
votes
0answers
22 views

Suggestion to Design API Centric Application using Appengine

I have been planning to create an new application. So I was designing the application structure.i know this application will be accessed form multiple devices and the app feature will be increased. ...
-1
votes
0answers
15 views

Automated Testing Tools in Java for desktop application [closed]

I want to write automated tests on Java for functional testing of windows GUI application written in Delphi7. I did automation testing of web applications (Java + Selenium WebDriver) but never deals ...
-2
votes
1answer
135 views

Should I use any Java framework to create a REST API server passing JSONs back and forth? [closed]

I'm new to Java Servlets and I want to build an application using Tomcat which will basically be a RESTful data management application with no HTML part. So, it will accept GET/POST requests, do some ...
-7
votes
1answer
68 views

How are constructors getting executed in this code snippet? [closed]

I am not invoking any constructor. How are they getting executed? I have only called constructor of class C. import java.lang.*; class A{ A(){ System.out.println("INSIDE CLASS A"); ...
0
votes
0answers
5 views

Arraylist - Resort Rental [migrated]

When the user enter the id and resort code, how can i search in the arraylist and get the array number that the id and resort code store in? using For-Loop. for(Person pe: guestList) { if ( ...
0
votes
0answers
23 views

how to separate the logic of different views when using android viewFlipper?

I use a ViewFlipper in a dialog. I want to fetch the data from the EditText in both of them and also add click listeners to both of them. I can write the whole code in one big file, but i want to ...
-1
votes
0answers
59 views

Java: Singleton Event Driven Design [closed]

I have a singleton class ( I make this as immutable ). This class is present in the base module. It has a static method getInstance() which will initialize a new object based on the data stored in a ...
1
vote
0answers
79 views

Should I assert in packages?

I have read a few asserts vs exception questions already; I ask specifically about package visible classes though. When you write a package, the classes marked with "public" are exposed to the ...
0
votes
3answers
147 views

Better creating a class with static methods or a object? [closed]

I have a class,, and it has 2 methods. I will use those methods just once , but i would like to know (in term of memory )would it be better to create a object(just once) and use the methods or make ...
2
votes
3answers
110 views

Simple Design for Singleton function in java for Kernel [closed]

I understand that Singelton helps to instantiate only one class AT A TIME. I try to learn how to Design for Singleton function in java. I want to know it better to understand Kernel. So I try to do ...
1
vote
3answers
97 views

Empty superclass for Collection of derived classes

Basically, what I would like to obtain is a way to iterate through ONE list, and call methods specific to the interface the objects in the collection implement. In my Java project, it would result in ...
0
votes
0answers
138 views

Is this the most efficient way to write this method? [migrated]

Newbie here, I'm writing a method that will compare two objects that store time. I wrote this: public boolean isBefore(TimeType secondTime) { if (_hour < secondTime._hour) { ...
-3
votes
0answers
18 views

JSP page - In a table <TD><input type = text name = “code”></TD> [migrated]

I have created a JSP page with a table containing two columns Code and Description ,the table data is input type="text" name ="code", the functionality which i have to implement is,if i type the ...
2
votes
5answers
335 views

how to design a stack without using java library or using list [closed]

I have a question how to design a stack without using list or array? This is one question that I want to think about as I want to better understand stack.
1
vote
0answers
106 views

What are the practical applications of nashorn [closed]

Oracle is putting a lot of effort into supporting Javascript on JVM. Rhino was quite capable as a JS engine, yet Oracle saw the need to create Nashorn and optimize it extensively to match V8's ...