Java (not to be confused with JavaScript) is a class-based, object-oriented, strongly typed, reflective language and run-time environment (JRE). Java programs are compiled to byte-code and run in a virtual machine (JVM) enabling a "write once, run anywhere" (WORA) methodology.

learn more… | top users | synonyms (2)

0
votes
0answers
4 views

Coding Button functions in separate classes

I've been trying to separate my button functions from my main GUI class The code works but as an programming beginner i want to hear if i'm doing things the 'proper' way. Point out what am i doing ...
2
votes
1answer
10 views

CombinedIterable for Java

This class combines multiple instances of Iterable into one and iterates through them in the order they are given to ...
1
vote
0answers
34 views

Object-oriented implementation of a real-world scenario of using a bathroom - follow-up

This is revised code for the previous question: Object-oriented implementation of a real-world scenario of using a bathroom Is there any object oriented way or design pattern I can use to make this ...
-1
votes
0answers
10 views

Client / Server chat GUI - How to call it [on hold]

I've created a java programme for a school project, it consist in a really simple GUI who manage all the student data. I've problem with the chat room, after created a Client and Server in two ...
0
votes
2answers
20 views

Java Swing Text Editor

Creating my first program in Swing and I was hoping to get some feedback. I'm looking for constructive criticism and tips for my swing code and my code in general. Don't really know what I'm doing so ...
-5
votes
0answers
13 views

integration test [on hold]

public class Diploma { ...
-3
votes
0answers
19 views

Computer has to Guess the User's Number (1-100) [on hold]

I've done this program in Python and it works fine. For some reason, in Java it's not working. ...
8
votes
1answer
43 views

Implementing Multi-File Programs in Vitsy

I'm the proud owner of the Vitsy programming language, which I've been working on for some time (except recently, because high school). It's only been used in PPCG so far, but I hope to expand it to ...
2
votes
1answer
26 views

Monster Buff/Debuff System Design

Below are a collection of classes that compose my buff/debuff system. The largest flaw in my design that I couldn't overcome is the base class Effect having an ...
1
vote
1answer
34 views

Validate a string for positive number and normal string

I have a method in which I am accepting a String clientid and that has below requirements: clientid can be a positive number ...
3
votes
0answers
20 views

TrieSet with Wildcard Search

What I'm ultimately trying to accomplish is a tool in which I pour some documents. Then I mark #x documents as desired and #y documents as undesired. My tool now is to analyse and compare the ...
3
votes
2answers
41 views

Implementation of stack

Task: Create a class RPNStack which represents a stack of objects of type Node. Class RPNStack contains only one private field top of type Node. Objects of type Node represent data that ...
0
votes
0answers
32 views

Ingest data from an RDBMS to Hadoop Hive database using Sqoop

Context: The below code will run a series of steps in an ETL workflow. I would like the code to be reviewed to avoid memory bottlenecks and null pointer exceptions etc. UseCase: Ingest the data from ...
2
votes
2answers
47 views

Matrix and Complex Numbers Parser

I have been working on a simple calculator project in Java since November 2014 as hobby. Now I want to add complex number support and Matrices. I also wants to add support for symbolic computation in ...
4
votes
1answer
50 views

Decimal numbers to English string representation

Is there anything that I could have reworked here? I have a Java 7 mind but I'm working on getting my Java 8 ready, so if there are any improvements over readability of performance here I'd love to ...
2
votes
1answer
45 views

Bracket Pairs Validation

Purpose Validate whether the open brackets within a String have matching closed brackets, in the correct order. The three types of valid brackets are ...
1
vote
2answers
63 views

Converting from Celsius to Fahrenheit, vice versa

My code does the following: Asks the user for the type of conversion, the degrees and spits the result back. It will prompt the user to ask for the type of conversion again if it's invalid. It will ...
1
vote
2answers
33 views

JavaFX FXML/window switcher

I would like to write simple application where I'm going to make a few views: Login Register Main app I think that my method is not the best way to do this. Can someone give me a tip? Main.java ...
1
vote
0answers
40 views

Performance of the String searching algorithm

I am trying to solve a string matching question mentioned here. I recently learned the Knuth–Morris–Pratt algorithm and tried to implement it to solve this question. But I am getting a TLE for this ...
14
votes
6answers
4k views

“Have a safe trip”… or not, depending on four conditions

I have 4 booleans and all must be met to determine the value of a String: ...
0
votes
0answers
20 views

Implementation of a VList [on hold]

Here is a VList I have implemented (gist): ...
8
votes
2answers
55 views

Compiler for a minimal LISP dialect to run on the Java Virtual Machine

As the title states, this is a compiler written in C with a ruby build script that translates a minimal LISP dialect and spits out an executable jar file. I designed this LISP dialect and named it ...
8
votes
1answer
76 views

Improving a robot's ability to navigate the plane with Karel J. Robot

I am in my first year of formally learning computer programming in high school (we are using Java). One of the tools we used was Karel J. Robot, which can be downloaded here. Although we finished ...
3
votes
1answer
32 views

Generate String with Random Consonants and Vowels

Purpose This problem comes from this dailyProgrammer subreddit challenge. The task is to take an input of C / ...
4
votes
2answers
97 views

Tic-Tac-Toe machine learning

I recently started getting into machine learning and I wanted to write a "beginner program" which would learn to play Tic Tac Toe. This code was inspired by a different program I saw, meaning some ...
-2
votes
0answers
29 views

Find word using Java [on hold]

I am trying to write a java class to find word surrounded by ( ) in text file. And output the word and its number of occurrences per line. How can I write this in java . Input file: ...
3
votes
1answer
36 views

Hash Matrix performs Gaussian elimination

This is the Hash-Matrix that I used in order to process the matrix for my quadratic sieve algorithm. You can find the full code at here(it's java 7), but I only want you to review this class. My ...
5
votes
1answer
123 views

Vowels in a String are in Alphabetical Order

Task Write an implementation that returns whether a String has vowels (English language) in alphabetical (A-Z) order or not. Feedback Is my ...
-1
votes
0answers
37 views

Simple java calculator using JOptionPane [on hold]

Firstly- thank you in advance for all the help. I am very new at java programming and I apologize if the answer to my question is incredibly simple. I am trying to create a simple java calculator ...
6
votes
1answer
85 views

Object-oriented implementation of a real-world scenario of using a bathroom

Is there any object oriented way or design pattern I can use to make this code better? How can I avoid casting in this code? What if I add new Object like WaterTank ...
3
votes
2answers
56 views

Bookshelf with Sorting, Categories and File I/O

I've been working on a project originally for school regarding object-oriented design, where I was supposed to write a class for a book and a bookshelf, and then have a driver class to add a couple ...
5
votes
5answers
489 views

Armstrong Number Validator

Purpose Validate if a number is an Armstrong Number. An Armstrong Number is a number such that the sum of the cubes of its digits is equal to the number itself. For example, 371 is an Armstrong ...
0
votes
0answers
13 views

Creating Numeric Battle System Backend in Java [on hold]

I've been trying to debug this simple battle system I've been attempting to achieve. I'm at a severely basic level and have made a debugging main file to figure out the source of the problem. The main ...
6
votes
1answer
42 views

Alpha Beta Pruning Optimization

I made a class that would do alpha beta pruning on a binary tree of 40 degree. However there is a time limit on a single move of 30 seconds. I am to play against my professor and his opponent class. I ...
3
votes
1answer
44 views

Java Swing Pong game

I recently created pong game using Java. This is my first time not copying any code from the internet or using any help. While it does work, my code feels well written but no streamlined or smooth ...
4
votes
2answers
89 views

Calculating Garland Degree of String

Purpose A garland word is a word formed by chopping off the last few letters and “wrapping around” to the start. For example: You can chop off the the trailing “on” from “onion” and still ...
3
votes
1answer
25 views

Piano Tiles-like-Game: Mouse LorMorR

I'm currently trying to get somewhat familiar with swing and so I made a little Game called Mouse LorMorR (Mouse Left or Middle or Right). The Game consists of a timer, a score display and three ...
2
votes
1answer
34 views

Heaping up with the inqueries

Challenge: Given three query types simulate heap operations. Specifications: 1. "1 v" - Add an element v to the heap. 2. "2 v" - Delete the element v from the heap. 3. Print the ...
6
votes
1answer
90 views

Java snow animation

I was inspired by this to write a graphic snow animation in Java/Processing. It works great, but it has some design issues. The full project is here on github; ...
0
votes
1answer
59 views

Make a command line application with parameter

I made a command line application which uses parameters. So I try to make a system like the linux command. So I have 4 parameters, initialized to a default value, used if wrong or none parameter are ...
2
votes
0answers
28 views

Note Management Program

Good night everyone. I spent the last week or so building this pretty cool note management program written with JavaFX. . Buttons are the method used to switch b/w open documents, and the "notes" are ...
3
votes
2answers
107 views

Evaluate whether string is in alphabetical order or reverse alphabetical order

Purpose This problem comes from this question on the dailyprogrammer subreddit. Basically, the task is to write an implementation that identifies if the characters in a ...
1
vote
2answers
85 views

Two and a sub string

Challenge: Given two strings, A and B. Find if there is a substring that appears in both A and B. Specifications: Several test cases will be given to you in a single file. The first line ...
4
votes
1answer
62 views

Loop through List multi-threading to ping hostnames

I am new to Multi-threading. I have had a go at writing some code that loops through an ArrayList, gets a hostname and then pings the hostname. If the hostname is ...
11
votes
5answers
811 views
+50

Enter my Matrix

Here is my next Java assignment: create a Matrix class that can add and multiply two matrices together. I was given some code as a skeleton and then fleshed it out ...
2
votes
0answers
62 views

First Android game: changing colors of neighboring squares

I have created a small game to learn more about Android. So the game is you start with a single gray square, and you try to take over neighboring squares. You can only attack 1 color per move, but ...
4
votes
1answer
58 views

Combination generator in Java

Given a positive \$N\$, the following class generates all possible non-empty sets \$A \in \mathcal{P}(\{0, 1, \dots, N - 1\})\$ in lexicographic order. Also, it provides a method that can be used to ...
-2
votes
0answers
27 views

Any way to set 'lengthy' HTML Content while sending mail? [closed]

I am able to send Email with this code. ...
3
votes
0answers
47 views

Java login system using JSP and servlets

The system is pretty simple. Here is how the database looks: ...
6
votes
3answers
207 views

Loading tab-separated tweet data into an array

I'm working on this school project and was wondering if there was any way of storing this information better, faster, more professionally. I'm also restricted to only using an array; don't ask me we ...