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

What's the returning a value in Java?

public void warning(){ System.out.println("Watch out!"); } public void warning(){ System.out.println("Watch out!"); return; } We must use "return" statement with void methods. Bot ...
-6
votes
0answers
26 views

Beginner's Java - Help Needed Using Eclipse! [migrated]

I have been busting my brain for days trying to complete this Java project and for the life of me I cannot get it to run. Here is what I am supposed to do: Write a program that calls each of the ...
-3
votes
0answers
31 views

Things which Java develops should know about php? [on hold]

I am a java developer starting out to write code in php. Would be great if there are some similar best practices between them?Just to get started in php if there are equivalent stuff for the ...
0
votes
1answer
44 views

Reflection performance in this iteration of a (probably) large excel file

I'm wondering the performance of reflection in this situation. I'm iterating a (probably) large excel file (let's say 3000 max) which it's going to be done from time to time, and the implementation ...
-3
votes
0answers
25 views

Which Rule engine should be used in a Java environment? [on hold]

Im looking to create/use a rule engine. The problem is to choose which one needs to be used. Drools seems to be the most comprehensive rule engine in the market. The requirements and the rules and ...
-3
votes
0answers
85 views

Why does Java apply the concept of value pooling only to Strings?

Why are Strings the only type to benefit from pooling in Java? There are many data types the concept could be applied to. What makes the String type different from int, char, etc?
0
votes
2answers
27 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{ ...
-9
votes
0answers
34 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 ...
1
vote
1answer
36 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 ...
0
votes
1answer
132 views

Shortest path to visit all nodes [duplicate]

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 ...
3
votes
1answer
36 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
1answer
115 views

Whats the difference between byte and Byte? [duplicate]

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 ...
-7
votes
0answers
15 views

Simple Reversi realization in Java [on hold]

Where can I get simple Reversi board game realization in Java for educational purpose? I found only very hard implementations. That is not good.
-2
votes
0answers
68 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. ...
1
vote
1answer
142 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 ...
1
vote
2answers
58 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 ...
0
votes
0answers
20 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
1answer
66 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 ...
-1
votes
2answers
73 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
55 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 ...
2
votes
2answers
242 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 ...
-4
votes
0answers
33 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?
-3
votes
0answers
34 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 ...
0
votes
2answers
165 views

What design pattern for changing interface?

Sorry guys, I should have clarified the fact that the modified method is abstract in Father. Then if the method signature changes, all its implementations in SonX shall also change(at least the ...
-6
votes
0answers
23 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
52 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 ...
2
votes
1answer
123 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 ...
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
72 views

Simple project ideas [closed]

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 ...
-2
votes
2answers
100 views

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

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 ...
0
votes
1answer
67 views

Continuous Integration for different languages [closed]

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 ...
4
votes
2answers
217 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 ...
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 ...
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. ...
-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
54 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 ...
1
vote
2answers
191 views

When should we work on GC optimization?

So, I've learnt about how GC works and how can I monitor it via VisualVM, but my question is about why we should ever perform GC optimization? In our web project (JSF/Spring/Hibernate) we haven't ...
-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 ...
-5
votes
0answers
63 views

Should I learn Java or Javascript? [closed]

I am a college graduate living in Southern California with a very basic understanding of java and programming in general. If my goal were to get my first job(or internship) as soon as possible, which ...
-5
votes
0answers
45 views

which language is best to learn [closed]

i know c,c++,html&css and basic java-script , i want to know that for which next language i should go for? i am totally confuse in ruby,java,php,asp,python,.net which should i start learning?? I ...
-1
votes
0answers
38 views

Persisting state of current execution in Java

I have specific use case, and I'm looking for opinion and suggestions on implementing this in Java as I'm fairly new to this. I have a dependency graph kind of process. The entity E in the processing ...
-2
votes
2answers
131 views

Why public access level method get overridden in java?

This question is raised with a clarification required to decide when to declare a method protected or public during class design of a package. My point is, if one needs to override a method of a ...
0
votes
2answers
157 views

Java card game design decision

I am making an application for a card game, with a standard 52-deck playing card. For now, I am writing a solitaire game with for learning purposes. I've had some experience making platformers and ...
4
votes
3answers
230 views

Why use arg type `class Object` instead of `Comparable[]`?

In the code below, I believe it would look more appropriate to make the method argument be of type Comparable[] instead of Object[]. The first reason it would be more appropriate is that one can be ...
0
votes
1answer
106 views

Is it possible to have a keyed dictionary stored on disk? [closed]

for example) would it be possible to be able to use the key of an item to access the item stored in a file out on disk (without searching through the whole file)? I'm looking fora general example of ...
0
votes
1answer
67 views

Matrices calculations on partial shape matching

I'm working in a shape recognition project where it is supposed for me to develop an application that receives two images: an original one and a sketch made by a user. I am supposed to detect contours ...
0
votes
2answers
143 views

Develop GUI and logic in a team the right way? [closed]

I am planning to start a small project with a friend. I will be developing the GUI using JavaFX in the MVC pattern and he will be responsible for the model/logic. My question is: how can we achieve a ...
0
votes
1answer
23 views

Using classes not designed for multiple sessions in servlet

I'm looking for a way to use a collection of Java classes in a servlet, which would provide some services to clients, but the classes were not designed with multiple sessions in mind, which seems to ...