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

Java Robot class highlighting text help

I'm trying to write a program that copies text from TinyChat(https://tinychat.com) and copies it to the clip board. Eventually it will take everything said in chat and paste it in Skype. Every message ...
-2
votes
0answers
39 views

How to encrypt communication between a desktop app and a restful web service [on hold]

I have built a Java desktop application that communicates with RESTful APIs deployed in a Spring Boot webapp. Spring Boot is configured to use embedded Tomcat. I know I need to encrypt the data ...
0
votes
1answer
69 views

Architecture for my Java application [on hold]

I try to create small Java tools to help me at my work every now and then. Usually these do not have to be pretty and I find myself coding a single, sometimes massive, Java class. However, now my plan ...
0
votes
0answers
23 views

Reading from html page that needs cookies passed and form data

I am writing a program in java in order to practice tough coding problems and learn more. Program description The program reads first names from a text file one by one, then enters them into facebook ...
2
votes
1answer
54 views

Advantage of Declaring and Initializing Different Object types?

I am learning how to use java to program, and am just learning about abstract classes and how they are useful. Say I have a class which extends another abstract class, which has 2 methods, one of ...
0
votes
2answers
49 views

Pattern for validating rules having different signatures

I have a class in charge of responding to an input event and maybe triggering another event. To decide, it has several rules to check. I'm trying to get away from a class looking like this: public ...
-2
votes
0answers
25 views

Is there a CMS that can be hosted online but is merely a backend for a desktop application? [on hold]

All the CMS's I've used and read about are geared toward building websites. I need to make a desktop application that connects to and grabs data and settings from a CMS-backed online source. There ...
2
votes
2answers
87 views

When to use ANTLR and when to use a parsing library

I've always wanted to learn how to write a compiler - I've decided to use ANTLR, and am currently reading through the book (its very good by the way) I'm pretty new to this, so go easy, but the jist ...
0
votes
0answers
52 views

What are the different types of whitespace referred to by Perl? [migrated]

I am trying to find the Java equivalents of the Perl regular expressions not supported by Java. These are, as listed in the Java Documentation: \h A horizontal whitespace \H A non horizontal ...
25
votes
4answers
3k views

Dynamic Code Evaluation in Java - Clever or Sloppy?

I am trying to create a flexible ACL framework in Java for my application. Many ACL frameworks are built on a whitelist of rules, where a rule is in the form of owner:action:resource. For example, ...
1
vote
1answer
35 views

DataThread class that doesn't extend Thread, poor naming?

I created a DataThread class that doesn't extend a Thread, but has one as a member variable. Favor composition over inheritance, is a rule that I heard of, but I am thinking that the name of the ...
-2
votes
0answers
32 views

Get from object or use variable [on hold]

Which one is better //somewhere here i have Test test = new Test(); object String name = "default"; if(test.getName() != null) name = test.getName(); or String name = "default"; String ...
0
votes
0answers
31 views

what is the relationship between CORBA, JMS and MDB?

In the context of my previous fuzzy question on microservices, please help me break down the terminology involved in these technologies: CORBA JMS MDB Utilizing JNDI, I believe it's possible to do ...
-1
votes
1answer
29 views

What's the best way to implement a real time show board to show results from concurrent result producers in Java?

I'm making a load test tool that launches multiple thread to simulate load on the target server. Each thread executes a predefined set of commands in the structure of TestSuite - TestCase- TestStep ...
0
votes
2answers
50 views

How is the best way to work with step by step documentation to software maintenance [on hold]

I'm working on a web project in java and I have a problem with the documentation we are making. The goal is to has step by step how to do some basic stuff for system maintenance, like add fields to a ...
1
vote
1answer
51 views

Non-fixed-size Fenwick Tree implementation

I'm planning to implement a non-fixed-size Fenwick tree. That is, a Fenwick tree that allows interleaving range queries with adding/removing elements. All implementations and samples I've seen so far ...
-2
votes
0answers
38 views

Java Web Framework for Functional Reactive Programming [on hold]

Given Java intricate relationship with web applications it appears to have shaped the design applied to how developers create web based applications. From Java 1 through Java 7 from around 1999 the ...
-3
votes
0answers
25 views

Multiple URLmapping using annotation not working in servlets [on hold]

I am using an annotation like this : @WebServlet("/Document/*") and trying to redirect using sendRedirect response.sendRedirect("Document/manpreet121FECF23A-D4D2-E411-BEC4-FCDD55FFFFFF"); I get ...
-3
votes
0answers
92 views

How much programming should I know at the age of 17? [on hold]

I love programming, I will study computer science in college, I am a junior in high school right now. I want to work for big IT companies such as Facebook, Google, Dropbox, Apple.. I want to have a ...
2
votes
0answers
114 views

Testing a method that reads from standard input and outputs to standard output [migrated]

I have a method which reads lines from standard input and outputs them to standard output. In a JUnit test, how can I have it send standard input to the method and how can it make assertions about the ...
-2
votes
0answers
38 views

Printing out 2d arrays which contain null values (java)? [on hold]

I'm very new to Java and was wondering if there was a way to print out a 2d array which contains null values, but instead of writing null it just prints a space. My code so far is: for(int i=0; ...
-3
votes
0answers
22 views

Setting up Struts 1.x in eclipse EE luna [on hold]

I need to set up Struts 1.x in Eclipse. I looked into a previous post in the link below . In one the the answers the link given is dead. The website where that tut is does not work ...
5
votes
1answer
168 views

Sometimes, “programming to interfaces” introduces possible (and avoidable) runtime exceptions?

Please consider the com.google.common.collect.ImmutableMap Programming to its interface, Map , creates a bug that could blow-up in the runtime as such: Map<String, Integer> myMap = ...
2
votes
2answers
89 views

Immutable vs Read-only vs Unmodifiable naming difference

So, I've looked at some similar questions asked here in regards to how these three should be used in naming. Usually, the answer is something along the lines of "it's conventional" and "just be ...
-2
votes
0answers
55 views

interoperability java and c++ [duplicate]

i want to write a program in two different languages java and c++ that needs a dynamic and interactive communication between its c++ component and java component.i know there is jni and jna for ...
-8
votes
0answers
71 views

How do I translate my source file to Java bytecode? [on hold]

I'm creating a new programming with JavaCC which is the parser. I want the parsed data to be translated to Java bytecode and compiled to Class file which later will be executed by JVM Edit: I'm a ...
-4
votes
0answers
81 views

Does C# meet my all of my needs? [on hold]

TL;DR: Are there any serious issues with using C# over Java for mobile dev and would I be more likely to find jobs in game development with C++ or C#? -- At the moment I'm familiar with HTML, CSS, ...
1
vote
2answers
91 views

OOP (possibly Java-specific): Comprehensive Set of Method Categories [on hold]

I am working on a coding convention to follow for my Java projects. I find it easier to find my way through a class when I group its methods by category. For example, rather than having each ...
1
vote
2answers
65 views

Is it a good idea to contextually name predefined functional interfaces?

I am currently working with Java 8 and using functional interfaces a lot. I often find myself writing code like this: public interface MessageHandler extends Consumer<String> { } Is this a ...
-2
votes
0answers
19 views

How do I access, and encrypt, the RTP stream created by SIP on Android? [migrated]

I am using SIP and an Asterix SIP server to create a p2p RTP connection between two devices. The RTP connection is created automatically when I create a call as described in Android developer guide: ...
1
vote
3answers
95 views

What is the best way to store and use an application level runtime parameter? [on hold]

I have to design a java console application which accepts a runtime parameter as an argument to the main method. The application will be eventually used by multiple scripts. I would prefer to avoid ...
-1
votes
1answer
31 views

JavaFX client side application [closed]

I am thinking of developing a JavaFX client application to connect to my backend database server for retrieval of data etc and display in my client app. For this, i would also need an ...
-4
votes
0answers
39 views

How can I create a program which records how much internet data is used by each website visited? [closed]

I don't believe this is even possible but it's worth asking, I would like to create a batch file that when run, it will record all IP addresses or URL's visited during an internet session. It won't ...
0
votes
0answers
4 views

Printing a shape based on inputs from the user [migrated]

I am trying to print a shape based on input; the shape is an "x". The inputs must be positive odd ints, and an arbitrary brush character. I have the code completed for the user input, but I need help ...
1
vote
1answer
67 views

Writing Multiple Files in Spring Batch [on hold]

So I want to create 6 delimited reports , they all use the same data source and same table , the query is different for each , they all are also independent. The way I have it setup right now I have ...
2
votes
3answers
154 views

Documenting intent Vs knowledge

It is said you should document the intent of your function or class which I agree with. However recently this line became a little bit blurred when I was wanting someone to document why this ...
0
votes
5answers
181 views

classes/inheritance, how do I handle special cases that require more change

I often find myself in this situation where I have a base class that does a lot of graphics. There are, for example, three strings that are positioned top, middle, bottom of an element. Like a scale ...
2
votes
1answer
50 views

How many threads should I use in my NIO server, details inside

I've built a Java NIO TCP server, it currently uses four threads. One ServerRunnable thread that uses a selector and three worker threads. I've been looking around for some information about this, ...
0
votes
2answers
264 views

Is it ok to break the “is a” relationship if I just want part of a class' functionality?

I asked a question about extending TreeMaps into "sort by value" TreeMaps on the "code review" site on stackoverflow. Based on the response, I re-wrote the code. I like it. But, it feels like I might ...
-2
votes
0answers
47 views

Simple way to write to SQL file from Java [closed]

I am creating an application to write to a .db SQL file that will be sent to a client and read from.I have seen many tutorials on SQL databases but what I needed was more in the realm of embedded ...
2
votes
2answers
169 views

Make functions that imply other functions

I'm developing a game that often has repetitious code that I can't simplify. Example of what I do normally: Square object; GL11.glPushMatrix(); // Pushes a matrix stack down by one. This allows us ...
7
votes
2answers
222 views

Java System class implementation

The Java System class contains various data members and methods that make perfect sense being there. For instance: System.in (variable) System.err (variable) System.out (variable) System.exit(int) ...
13
votes
6answers
1k views

Is creating the objects you think you will need ok in a first test in TDD

I'm fairly new to TDD and I have trouble when creating my first test when it comes before any of the implementation code. Without any framework to the implementation code I am free to write my first ...
0
votes
4answers
385 views

Why is it a bad practice to use underscores in names in Java? [closed]

I'm quite used to name methods as fooBar() and variables as foo_bar. For longer names, I find the underscores much more readable. In our university Java courses, we're discouraged from using ...
0
votes
2answers
110 views

storm topology to handle “dating website”-like workloads

suppose im writing a dating website, similar to okcupid. there are profiles, and i need to compute the (N^2) "match" table - given every 2 profiles whats the match between them? i was thinking this ...
3
votes
3answers
196 views

How do you iterate through an array and delete an element?

I have an array and I can iterate through it. I know that it is impossible to change the size of an array; however, how do I take out a certain element that I not want in the array anymore? Example: ...
1
vote
2answers
139 views

Observer pattern without state change?

My question is whether there is a similar pattern to Observer that does not imply a state change in the observed object. The following is a concrete example: I have a ConnectionFactory class which is ...
4
votes
2answers
261 views

What is the correct approach for creating an application around a library?

I have a library that defines messages. In my particular instance, it's autogenerated code from an XSD using JAXB (Java). The messages can be very complex, with some members as objects and those ...
-2
votes
2answers
57 views

Should POJOs be abstracted?

My coworker tends to have each POJO implement an interface. Like Customer would implement ICustomer, with the motivation that we can now have multiple implementations of ICustomer. One example would ...
0
votes
1answer
59 views

Is it a good idea to include extra libraries in jars?

When creating executable jars for a java project, it is possible to create jar bundle which includes all the external libraries used. It is also possible to create a jar without those external ...