Questions tagged [java]

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 bytecode and run in a virtual machine (JVM) enabling a "write once, run anywhere" (WORA) methodology.

Filter by
Sorted by
Tagged with
1
vote
0answers
4 views

Find all combinations of numbers of a set that add up to a given target - avoid for loops

I am thinking about the following problem: Consider a 3-numbers lock, i.e. a lock which has three little number wheels that opens whenever the sum of these three numbers equals 75. I know, this doesn'...
0
votes
0answers
10 views

Java 8 ThreadLocal Date With Lambda

I'm using Java 8 lambdas to initialize thread local date variable. I am accessing these methods in multithreaded program. Is it going to create garbage references as I am not using .remove() method on ...
-1
votes
0answers
34 views

Is this object oriented code ok? (“Algorithms 4th Edition” by Robert Sedgewick and Kevin Wayne.) [closed]

I am reading "Algorithms 4th Edition" by Robert Sedgewick and Kevin Wayne. I know little about object oriented programming. https://algs4.cs.princeton.edu/code/edu/princeton/cs/algs4/Graph....
0
votes
0answers
14 views

Java GUI numbers to letters converter [closed]

I have this program, where I have java GUI and I wanted to ask if anyone would help me with a code in private class ActionRun to let user input numbers and output it's alphabetical order. For example -...
2
votes
2answers
89 views

reddit-like GUI

I am not very familiar with Swing but am attempting to make a Reddit GUI. I've finally got everything to work as expected but I must admit, it's quite mundane and not very nice to look at. I want to ...
-2
votes
0answers
16 views

Add randomely generated number to an if condition [closed]

a heading on the top that says “Yay” instructions "Yes or No". add 4 Quotes. When the user enters "Yes", the program generates a random number between 1 and 4. The program will ...
0
votes
1answer
62 views

Correct use of Serializable with lambda functions

I'm practicing saving and reading serializable objects when a friend told me serializable objects have no use in real life, that I'd better focus on JSON or XML to serialize my objects when I came ...
1
vote
1answer
50 views

Reading data from multiple different resource bundle property files in Java

I have class structure to read the data from resource bundle (property files). ...
-2
votes
0answers
29 views

Check loop condition before entering the loop [closed]

I've got this Java 8 code: ...
2
votes
2answers
78 views

Parking places design

I got a question: Design a parking system. There are 3 types of parking spaces: big, medium and small. Implement ParkingSystem class(int big, int medium, int small)....
0
votes
0answers
22 views

The Functional Enterprise Java Bean 3

I've coded this @Stateless session bean: ...
-3
votes
0answers
27 views

How can I store user input in arraylist java [closed]

when i run the code i want to save output that the user will enter, so , I will not need to enter every time I run the code to enter again , when I enter to display all student or faculty or book it ...
-3
votes
0answers
32 views

Four methods that ask for User Input [closed]

Basically each time I try to run this program, and it gets to the printing steps it also skips through the print part of asking the user the first name, last name, and the character they've chosen. I ...
1
vote
1answer
53 views

Simple Ratelimiter Feedback

I'm preparing for coding interviews and I wanted to get feedback on this question which asks you to write a simple ratelimiter that can handle 5 requests every 2 seconds for example. Since it is for a ...

15 30 50 per page
1
2 3 4 5
697