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
9answers
2k views

The definition of C-based language

What is the definition of C-based language? Is C# considered to be C-based? Is Java considered to be C-based? Furthermore, what does it mean for a language to be based on another language anyway?
0
votes
0answers
31 views

asynchronous event notifications? Sprint Boot

how to implement notifications on the client side (HTML, JS), sent by an asynchronous method on the server side? I'm using Spring Boot. Understand the cycle: the user performs a procedure in the ...
0
votes
1answer
110 views

Using database connection on multiple threads

let's say I have a database connection in the class Database which offers the following public methods public synchronized void open() {} public synchronized void close() {} public synchronized void ...
2
votes
7answers
546 views

C++ delete vs Java GC

Java garbage collection takes care of dead objects on the heap, but freezes the world sometimes. In C++ I have to call delete to dispose a created object at the end of it's life cycle. This delete ...
0
votes
2answers
166 views

What is the role of “throws exeption” in method definition in Java?

Some methods are deciared this way: public int myMethod() throws Exception { (return an int or throw Exception if method fails). However, stub methods in NetBeans look like public class JavaApp { ...
0
votes
2answers
71 views

Best Communication strategy for monitoring dashboard

I have a requirement where I need to display certain stats on Admin Dashboard in my web application (Angular+Java). These stats (transnational data) are being generated on different servers (connected ...
1
vote
0answers
55 views

PDF encryption anomaly; version 1.5 using AES

I'm not sure if this is the correct forum to ask this question so please accept my apologies in advance if this is the wrong place. I recently created an encrypted PDF file using PDF Studio 11. The ...
0
votes
0answers
61 views

How to return Java object from REST service jersey

I have spent days trying to fix a problem. I have a REST method that accepts a Java object, does some calculations through a rules engine (Drools) and return another Java object. The rule engine ...
1
vote
1answer
143 views

what is this kind of object creation?

final CyclicBarrier cb = new CyclicBarrier(value,new Runnable(){ public void run(){ ...statements } }); suppose you have a cyclic barrier in which one of the the arguments is the direct ...
2
votes
2answers
576 views

How to efficiently handle related data in MVC?

Talking about MVC with servlets and JSP's, in a context about products and manufacturers , when querying the application for a list of products: the servlet loads a list of products from the ...
0
votes
0answers
103 views

Best way to spawn enemies with independent (x, y) positions?

I am trying to spawn simple GRect enemies on different (x, y) positions, although, the problem is that I need the enemies to operate on different movement speeds. while(true) { enemy[i]....
0
votes
0answers
22 views

Java Drag and Drop, registering certain parts of the object

Say I have an application where the use creates an electrical circuit visually, how would I go about registering when two ends meet? I've seen this thread http://stackoverflow.com/questions/8562743/...
0
votes
3answers
109 views

Cyclic dependency in this project design

I have 2 modules (containing multiple classes). Let's call them Module A and Module B. Module B has a dependency on Module A: Module B -> Module A. Now, I have created an utility class C, which A ...
-1
votes
1answer
30 views

Language cross platform that allows different socks connection per thread

Hello i'm developing an app that needs to do many requests with different socks connections. I was doing it in C# but i'm not sure how well it will work on a linux server even with .net core . Java ...
0
votes
0answers
46 views

Making DAO's independent on each other

I have these two classes (Getter/Setter/Constructor omitted): public class Company { private String name; private String adress; private List<Employee> employees; private Uuid ...
1
vote
1answer
66 views

Collect and prcess data from multiple threads in Java

There is a Java program that reads a list of orders and for each order starts a thread that receives data from SQL and prints the list of items in a given order to an order_name.html. I want to write ...
1
vote
1answer
50 views

UML: do I use aggregation or composition in this case?

I would like to draw a UML sketch to communicate part of a software but the type of relationship between classes does not seem very clear cut to me. Let's say I want to periodically fetch the recent ...
80
votes
9answers
7k views

Has / can anyone challenge Uncle Bob on his love of removing “useless braces”?

I hate referencing paywalled content, but this video shows exactly what I'm talking about. Precisely 12 minutes in Robert Martin looks at this: And says "One of my favorite things to do is getting ...
2
votes
1answer
73 views

Should domain models instantiate other domain models?

I'm reading Domain-Driven Design at the moment and I'm trying to understand what should go in services and what should go in domain models. Say there is an application where you can reserve seats for ...
0
votes
3answers
296 views

Why do we call Java open source, when development or contributions are not decentralized

Open source software should be developed by different contributors in decentralized fashion. I understand that Open JDK is reference implementation of Java which is open source and it allows ...
7
votes
2answers
259 views

What is an output argument, as refered to in Martin's Clean Code?

On page 45 of Robert C. Martin's Clean Code: A Handbook of Agile Software Craftsmanship, Martin writes that output arguments should be avoided. I'm having trouble understanding the meaning of "output ...
0
votes
1answer
152 views

Recently moved from java to javascript on nodejs, how to maintain code? Help!

I recently moved from java to javascript on nodejs. I was very excited, opened up my intellji IDE for an existing nodejs project only to find I cannot know what the parameters I see functions ...
0
votes
0answers
17 views

Are there special considerations to take for the database when using Hibernate's @Version?

We've encountered a bug which is solved by adding a @Version-ed field. However, I'd like to know if I need to add something special in the database (Oracle 11g), like adding some index on the new ...
1
vote
1answer
73 views

Android Studio, HTML and Java Correlation

I've recently started designing apps in Android Studio, and I've noticed that the same operations (for example, using a widget) can be completed by either going into the activityname_java file and ...
4
votes
4answers
2k views

What is the difference between Callable<T> and Java 8's Supplier<T>?

I've been switching over to Java from C# after some recommendations from some over at CodeReview. So, when I was looking into LWJGL, one thing I remembered was that every call to Display must be ...
0
votes
0answers
12 views

JPA: Property/encapsulated objects instead of fields

I'm moving to JPA (JavaEE, Eclipselink) from a very large C# project. The classes were not using simple fields but Property objects. Example: //C# public class State : DataObject<State> //base ...
4
votes
2answers
176 views

The order of values in ? : expression

Which construction is more readable: someVariable == null ? SOME_VALUE : someVariable; // avoids negation someVariable != null ? someVariable : SOME_VALUE; // normal situation first I have to ...
4
votes
1answer
474 views

Should I declare the most specific type as return type of method?

In Android I can put only ArrayList of Parcelable objects in Intent: Intent putParcelableArrayListExtra(String name, ArrayList<? extends Parcelable> value); I can't put in there a List<? ...
2
votes
1answer
122 views

Should I return Iterable or Enumeration in Java

In order to achieve better immutability, should my API return java.lang.Iterable<T> or java.util.Enumeration<E>? Since Iterable has a remove() method, one could say Enumeration is the ...
0
votes
3answers
228 views

DDD Request Validation Handling

I stuck somewhere that I can't find a solution! There are plenty of validation questions here, but as far as I see, most of them were asking about entity validation. But what about request validation? ...
2
votes
2answers
116 views

Unit testing / How to validate private fields of a newly created object?

I have a basic unit test (for the sample) that involves this code: void testShouldCreateACar() { Car car = someone.createFerrari(); assertTrue(car.name == "Ferrari"); // can't access name since ...
4
votes
2answers
245 views

Generating Java Classes with Compile-time Value Parameters

Consider a situation where a class implements the same basic behavior, methods, et cetera, but multiple different versions of that class could exist for different uses. In my particular case, I have a ...
-1
votes
0answers
38 views

Changing data in LVM format to CSV using Java?

So I need to take .lvm files -- which has a header and the data is separated by tabs -- and make them into .csv files with no header and data separated by commas. Am I able to do this using java? I ...
0
votes
2answers
78 views

Using Super.someMethod for added clarity?

Is Super.someMethod() a good practice to add clarity to the code by explicitly stating that someMethod is not a method included in the current class but in the parent class? For instance, would this ...
0
votes
1answer
191 views

Java is not actually a pure object oriented programming language since it needs primitives Why?

here my Question it is said that "Java is not actually a pure object oriented programming language since it needs primitives" I want to know that how data types can affect to java be an pure object ...
0
votes
0answers
12 views

JVM run-configuration launcher for production?

Does anyone know if there is such a thing as a run-configuration launcher for the JVM for "production"? Where you can set environment variables and arguments, just like in an IDE ?
-1
votes
0answers
56 views

Is it better still use Java\Spring MVC or a lighter technology as PHP\Laravel for a new project?

I am a Java EE developer that obtained the Spring Core certification (related to Spring Framework). In the last year I have gained experience with this framework. I am also pretty confident in the ...
1
vote
1answer
27 views

Redesigning schedule value hierarchy

I have a couple of schedule value classes that represent the value a schedule holds for a specific slot. First, there's the ScheduleValue class for schedules with two dimensions, where the first one (...
-2
votes
2answers
75 views

Interpreting JAVA code - crashes [closed]

Suppose the user enters 1 then 2 then 3 etc in response to prompts for as long as they can. Can someone help me write down the dialogue between the user and the code. Where does the crash occur? ...
7
votes
2answers
729 views

Implementation of communication between packages (Java)

I'm making a project with 5 packages. The packages can communicate with each other by sending Messages to a central MessageQueue in the Main package and that MessageQueue takes care of all the ...
0
votes
0answers
12 views

Good Practice ADF Jdeveloper: Read Only View Obejcts and Write View Objects?

I just started to work with Java ADF and JDeveloper, I was wondering whether defining "Read Only" view objects and "Write" view objects is a good practice? I mean. Right now I can't find any scenario ...
5
votes
0answers
222 views

What lambda function optimizations, if any, are planned for Java 9 and beyond?

I'm working on a high-performance project where Java 8's lambda functions are enormously useful. I've found, however, that they're memory inefficient when used en masse. For example, suppose I need to ...
0
votes
0answers
26 views

Spring security @PostAuthorize anotation don't work fine sometimes

I'm using Spring Security 4.1.0 for security of my java web application. I use @PostAuthorize annotation for get method as follow: Interface: @PreAuthorize("hasAuthority('get')") @PostAuthorize("...
-3
votes
0answers
23 views

Spring MVC OpenLDAP Authentication [closed]

I have made a Spring MVC user login Java application, but I want the user login to get authenticated using OpenLDAP ? Can someone explain the procedure ?
0
votes
1answer
69 views

strategy to display value for a html select

Strategy to display value for a html select I have a spring boot, application. On the client side, I use JQuery I would like to know the strategy to display "static value" for a html select. ...
1
vote
6answers
521 views

Possible way to make java class builder more abstract by using interface required keys

I'm looking for a more abstract pattern for builders that handles required fields without the need of writing a validator that checks if all requried fields are set. I like this builder. But is ...
1
vote
0answers
65 views

Should I annotate all the entry points in my library?

In a library project, I see numerous warnings suggesting that I reduce the visibility of public classes and methods. (Or in the case of methods I haven't written tests for, warnings about them being ...
1
vote
1answer
48 views

Eventing solutions for java legacy applications too old for real JMS queue/topic eventing?

What are some architectural solutions that can mimic eventing for systems (Java) that are too old to implement eventing solutions, such as conventional Queue/Topic based JMS messaging? I have a ...