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

-3
votes
0answers
15 views

String pooling concept comes only with string not with other data types why.?

why string poling concepts comes only with string not with any other data types in java. as we have many data types and variable types why only string has been selected for this pooling concept why ...
0
votes
1answer
55 views

Shortest path to visit all nodes

I am given a set of tourist attractions(nodes identified by x, y) and i need to find the shortest path to visit them. The way i thought of it, is i will ignore if there are streets available and ...
0
votes
1answer
10 views

Which 'InputStream' subtype is used by 'Socket' type object here?

In the below server socket program, byte stream object is used to read data from client, as mentioned - InputStream in = socket.getInputStream(); public class SingleThreadTCPServer{ ...
0
votes
1answer
25 views

Query on java I/O BufferedOutputStream write() method

Below is the code that is written using byte stream non-buffer class FileInputStream and FileOutputStream with the usage of explicit user buffers. public class FileCopyUserBuffer{ public static ...
-8
votes
0answers
25 views

Hello everyone pl solve my query [on hold]

hii its a little query for me as i was looking for a career in the java but didn't get the same.How could be the field of android developer, is it equivalent to java ...
2
votes
1answer
26 views

Template pattern with varying input type in overridden method

I am trying to use template pattern to define a generic algorithm in java. But the method that needs to be overridden, takes an object as input. This object will vary depending on the concrete ...
0
votes
4answers
654 views

Why 'List<E>' is an 'interface' but not 'abstract class'?

While defining the hierarchy, one can think to embed the abstract method(behaviour) in abstract class only because the derive concrete class posses that as core behaviour with it's specific ...
0
votes
1answer
78 views

Whats the difference between byte and Byte?

Alright so of course, I know the differences. byte is a primitive and Byte is an object. Byte offers more functions but there is one thing I dont understand. Why would anyone create a variable using ...
-1
votes
0answers
51 views

Is it worth it to learn Swing? [on hold]

I'm a computer science student (2nd year), and in my university, they teach us java but they do not teach us how to make GUI's wich Java. Here, they say that Java Swing is slow and useless to learn. ...
-6
votes
0answers
12 views

Simple Reversi realization in Java

Where can I get simple Reversi board game realization in Java for educational purpose? I found only very hard implementations. That is not good.
1
vote
1answer
129 views

Why is close() implemented in InputStream/OutputStream?

It make sense to see close() as non-core functionality of stream objects. This is the reason this method is placed in interface Closeable. One evidence is that class ByteArrayInputStream does not ...
0
votes
2answers
105 views

What design pattern for changing interface?

Say I have the abstract class Father, and three(or more) of his children class Son1, Son2 and Son3. Now I have to change one method, in other words, add an argument to one method of Father. However, I ...
0
votes
1answer
421 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 ...
1
vote
2answers
50 views

Query on hiding implementation details in java

With the below piece of thread related code, I see that author of Thread class is hiding the details about the working of start() method. What a user of Thread class need to know is, class Thread ...
-1
votes
1answer
59 views

Thinking in Java 4th edition - How to read efficiently? [on hold]

a) Is there anyone who could give me some tips how to read Bruce Eckel's book efficiently? So far I read 230 pages of Eckel's book in 19 days (i made all the exercises, coded alot) - i went trough ...
0
votes
0answers
19 views

vert.x message bus architecture

A large part of the vert.x architecture is around the message bus, and message passing between verticals. The main idea I guess being that I can create multiple modules (possibly in multiple ...
-1
votes
2answers
66 views

Initialize in Field, Constructor, or Argument

If I know what a field will be initialized to, should I initialize it in the field, constructor, or receive it as a parameter? For example, where should I initialize an ArrayList? Initialized in ...
-4
votes
0answers
53 views

Where do programmers look for reference/documentation about Java's features/libraries/functions? [on hold]

Rookie programmers learning the language usually use a book or online materials.They are introduced to the language's syntax, common used functions for text processing or math operations. Only a small ...
4
votes
4answers
597 views

Naming boolean field that is a verb

In Java, by convention getter and setter for boolean fields will be isField() and setField(). This works perfectly fine with field names that are adjectives like active, visible, closed, etc. But how ...
2
votes
2answers
236 views

Unit testing and reality [on hold]

I m actually studying Unit testing, reading some articles on the internet and trying to understand how it works exactly, but it's not very clear for me actually. What should I test ? I have seen ...
14
votes
6answers
1k views
+50

What is the value of workflow tools?

I'm new to Workflow developement, and I don't think I'm really getting the "big picture". Or perhaps to put it differently, these tools don't currently "click" in my head. So it seems that companies ...
-4
votes
0answers
32 views

can someone explain me what does a <enum class>.values() functions actually do? [on hold]

I used a values() method in an enhanced for loop to traverse all values in my enum class. But what does this method actually do?
0
votes
3answers
248 views

Java 1.7 library with a Java 1.5 program - what are the options

I have a class library which is compiled with JDK 1.7 It uses several 1.7 features and classes and would be very difficult to get it recompiled in JDK 1.5. This needs to integrate with an old legacy ...
-3
votes
0answers
32 views

Java 1.6 on Eclipse: What does ERROR “annotation must be explicitly requested,” mean when creating new classes? [on hold]

I've copied code from a YouTube tutorial and for some reason the program terminates but it never renders the window. I've included Eclipse in firewall exceptions on Mac, I'm sure my system currently ...
4
votes
1answer
776 views

Attachment handling for web application with Jackrabbit

I need to manage attachments on my Spring web application and I thought to use an open source repository. My app it's a job approval system using J2EE / SPRING 3 Framework and Postgress DB to allow ...
2
votes
1answer
390 views

Push-Based Events in a Services Oriented Architecture

I have come to a point, in building a services oriented architecture (on top of Thrift), that I need to expose events and allow listeners. My initial thought was, "create an EventService" to handle ...
-6
votes
0answers
21 views

Link's massive in webdriver [on hold]

I want create script where the 1st step is to open a website and the 4th step is to click on a button. The button I want to take is from massive. I'm getting an exception. Can you help me or give me ...
-2
votes
0answers
50 views

transitioning from C# to Java. [on hold]

I have spent the last five years programming in C#/.net and have been transferred to a Java team. What are some of the things I need to watch out for? What are some of the more enjoyable things I ...
-4
votes
0answers
34 views

Any birdview article about Web development with Java? [on hold]

I am new to Java Web development. And I am tasked to create a prototype with Java and related technologies in a short time. So I am looking for some birdview article about the Web development ...
4
votes
3answers
229 views

Batching immutable object changes?

With immutable models, what would be the best way to batch several changes? For example, let's have a Book that is immutable. I need to change both title and year. I could change one by one, but that ...
7
votes
1answer
6k views

What have my fellow Delphi programmers done to make Eclipse/Java more like Delphi?

I am a veteran Delphi programmer working on my first real Android app. I am using Eclipse and Java as my development environment. The thing I miss the most of course is Delphi's VCL components and ...
23
votes
2answers
5k views

How to improve upon Bloch's Builder Pattern, to make it more appropriate for use in highly-extendable classes

I have been greatly influenced by Joshua Bloch's Effective Java book (2nd edition), probably more so than with any programming book I've read. In particular, his Builder Pattern (item 2) has had the ...
2
votes
1answer
605 views

How to translate SQL query into REST API requests?

Let's say I have a machine-readable description (such as in WADL, Swagger or RAML) of a REST API that provides interface to a database. My users submit queries about underlying database in form of ...
3
votes
1answer
963 views

Passing a Context around with dependency injection

In the project I'm working on, I'm using Guice and trying to do as much as possible with Dependency Injection. However, there's one little snag; many of my objects rely on an object Context. This is ...
2
votes
1answer
121 views

Why use a enum to create the singleton pattern [duplicate]

Why would you use an enum to create a singleton pattern? To what purpose would it serve over a conventional singleton pattern? I have seen the above used. The code uses an enum to create this pattern ...
4
votes
2answers
214 views

Is it better to use strings or int to reference enums outside the java part of the system?

We were having a discussion at my work about the use of enums in Java. A coworker was arguing that when using enums on the server-side, whenever required we should use string to reference to it (for ...
2
votes
1answer
30 views

Applying initialization-on-demand holder idiom at variable level rather than class

I was looking for the idiomatic way to implement thread-safe lazy initialization for a configuration collection retrieved from the DB inside a Spring bean. I decided to adapt the ...
-3
votes
3answers
71 views

Simple project ideas [on hold]

I am looking for simple project ideas to help teach some of my fellow students. I am trying to team them the following: -If / else if / else -For and while loops -Logical AND / OR -creating ...
9
votes
5answers
2k views

Is try-finally expensive

In case of code where you have to do a resource cleanup before exiting a function, is there a major performance difference between these 2 ways of doing it. Cleaning the resource before every return ...
-2
votes
2answers
100 views

What is a good name for a class that interacts with a command line tool? [on hold]

I'm writing a program in Java that includes a component that will interact with command line tool. In particular, I want to automatically process some data from an open-source GitHub project, so one ...
25
votes
4answers
25k views

What is the point of using DTO (Data Transfer Objects)?

What is the point of using DTO and is it an out dated concept? I use POJOs in the view layer to transfer and persist data. Can these POJOs be considered as an alternative to DTOs?
0
votes
1answer
67 views

Continuous Integration for different languages [on hold]

So, I understand Continuous Integration in theory, and have used Beanstalk. However, I've been charged with creating the process at my current PHP shop. My hope was maybe PHPCI, since it looked ...
0
votes
1answer
135 views

Is Default Package included in the Package Level Access?

I would like to know how the default package is defined in Java.I know how public and private access is defined but I don't know whether there is any default package access that is defined in package ...
0
votes
0answers
3 views

Cannot find bug in NegaMax implementation for java chess game [migrated]

I am having trouble identifying the error in my negamax implementation. It is not properly assigning the correct score except for ply 0 where it works. Obvious "pawn capture Rook" opportunities are ...
0
votes
1answer
25 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
1answer
34 views

Field being skipped on use of Scanner .next() method and spaces being left out [closed]

I have a class called Student containing certain fields and I was using the following details to enter the values in its fields: Scanner s1=new Scanner(System.in); Student[] s=new ...
0
votes
0answers
72 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
176 views

Best OOP pattern to use for creating a commandline SQL API for a proprietary json based company datastore

We need to create a SQL commandline tool for querying a proprietary json based datastore. I'll be using java. Any suggestions on the primary OOP design pattern I should use for building this API? ...
-2
votes
0answers
31 views

A library to be able to reproduce mp3 files in Raspberry Pi [closed]

I've been having a hard time looking for a simple library to reproduce audio files (mp3 precisely) , i've tried pyglet for python, but didn't succeed, but look, the only thing i want/need is a library ...
-1
votes
0answers
52 views

What else can kill a JVM? [closed]

When A JVM (Java process) dies unexpectedly, it can be an inside job (OutOfMemoryException, or OOME) or it could be from an external stimulus. As far as internal mechanisms go: Any uncaught ...