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

Selenium Web Driver logger work [on hold]

I am using selenium web driver for Chrome and want to log steps of script but it always overwrite previous logs. I'm using the following code for logging: ...
0
votes
1answer
44 views

Making a database and related operators using files and JSON in java

I'm trying to write a program that reads operations from a file. these operators look like below : CREATE TABLE student(id:integer, gpa:decimal, name:string, family:string,isMale:Boolean) INSERT ...
-4
votes
0answers
31 views

I wrote a Java program to load and play an audio file, can anyone point out what the problem in the code is? [on hold]

package rico; import java.applet.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; public class Rico extends JApplet { private AudioClip sound1, sound2, currentSound; private ...
-2
votes
1answer
44 views

Java Non-static method cannot be referenced from a static context [on hold]

I want to make a reservation system for a camping. I also wanna know how many people already have made a reservation. Im using the iterator but I get the error "Non-static method getPersons() cannot ...
0
votes
1answer
44 views

Using XML to store and edit data records in Java

I want to use XML to store data for an assignment . In this Java assignment I'll get data from the user in form of lines in a file below INSERT INTO student(id,name,family,isMale) VALUES ...
-1
votes
0answers
34 views

Monitoring an .mp2 file in Linux to see if it's used by another process

I'm working with an application that creates .mp2 audio files. I need to make sure the audio files are completely released by the application before moving the file to another directory. I have a ...
0
votes
1answer
135 views

Should I always call super in Java? [duplicate]

Anti-pattern considerations aside, should I always call super in Java when overriding methods, even when the method is empty? Take a look at the code below, this is an excerpt from AsyncTask and can ...
0
votes
0answers
34 views

Spring Boot Hibernate and JSR 303 - response formatting

Sifting through forums I can't seem to stumble into an issue solution I've been haveing with Spring Boot + JPA and JSR303 bean validation. Simply put validation works but but when say ...
0
votes
0answers
52 views

How to create methods at runtime for scripting purposes? [on hold]

!!! There's a TL;DR question at the bottom of this !!! I'm looking into writing a Java API that developers can implement that will allow users to write their own scripts that can interact with a ...
-3
votes
1answer
74 views

Creating multiple houses in Java? [on hold]

everyone! I created a program that would draw a house in Java, which is: import java.awt.*; import java.applet.*; // Program to draw a house public class House extends Applet { public void ...
-1
votes
0answers
84 views

Error: Code too big for 64k [on hold]

Im having a bit of an issue with a simple program I'm trying to build. Im using an IDE to code a program I wish to turn into an app in a few months. After 7500 lines of code I receive and error ...
0
votes
0answers
4 views

Java j2ee JSTL cannot print a list of objetcs [migrated]

i'm currently working on a small Java J2E project. I want to print a list of objects in a *.jsp page, but there's an error i can't seem to get rid of. My .jsp page : <%@ page language="java" ...
-3
votes
0answers
52 views

Generate random numbers in java…! [on hold]

I'm writing a code for a command line game in which I want to shuffle numbers randomly. i created 3 different functions. Each function generates a number different from other. and those 3 functions ...
-2
votes
0answers
14 views

Java Robot class highlighting text help [migrated]

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 ...
0
votes
1answer
80 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
1answer
36 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
63 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 ...
1
vote
2answers
81 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
30 views

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

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
105 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 ...
26
votes
5answers
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
36 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
36 views

Get from object or use variable [closed]

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
35 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
31 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
59 views

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

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
73 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
42 views

Java Web Framework for Functional Reactive Programming [closed]

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

Multiple URLmapping using annotation not working in servlets [closed]

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

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

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
115 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
40 views

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

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

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

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
181 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
90 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 ...
-9
votes
0answers
78 views

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

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

Does C# meet my all of my needs? [closed]

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

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

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

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

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
41 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 ...
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
71 views

Writing Multiple Files in Spring Batch [closed]

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
155 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
183 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
56 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
268 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 ...