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.
0
votes
2answers
34 views
Calculating the Factorial of a number
I am looking for feedback for the implementation for calculating factorial of a number. I have tried to do with a loop, recursion and in a mutlithreaded way.
...
0
votes
0answers
18 views
Speed up Magic square program
I have written a Java program to calculate magic squares with recursion and backtracking. A 3*3 Magic square is calculated in about 1 sec, but a 4*4 needs about 50 minutes on my laptop with Intel i5. ...
-3
votes
0answers
16 views
Static factory method vs adapter
I have a problem which approach is best. Please imagine system written in a hexagonal architecture where each service method accepts class or classes. Let say for example my method create User.
1. ...
-7
votes
0answers
20 views
kindly I need the code for this [on hold]
A company has general employees and manager.employees have PF number name and salary.Managers are employee but have departments they head.one should be able to create objects of both categories and ...
2
votes
0answers
14 views
Card Based game in android
I am developing a card game in android, this is my first time i am working in android, the game contains following features
It will be a 6 player game.
There are two decks on the table, one with ...
0
votes
0answers
33 views
Modeling an Access Control Policy as a Class in Java
I'm a beginner with Java, I'm trying to create a class based on an entity: Access Control Policy.
Access Control Policy: An access control policy p is a tuple (sid,tf,exp,pr), where sid refers to the ...
1
vote
0answers
41 views
Java => Caesar Cypher
I already asked for help in optimizing a simple Caesar Cypher code in java here : Cesar code in Java
I tried to implement all the advice from that subject and now I am asking again.
Do you have any ...
-1
votes
0answers
10 views
process image using fresco on android then display it in draweeView [on hold]
How i can process an image from gallery gallery before displaying it in draweeView using Fresco.
what i'm did so far was..
...
0
votes
2answers
35 views
Printing the status of a database insertion as JSON
The controller is currently inserting a record into the database and returning a JSON response as shown below in the try-catch block. I can see the ...
-1
votes
0answers
10 views
Data structure method in java [on hold]
My question is : How can I connect the first node, last node and new node when I add item at the beginning or at any position? Assume that there is a interface called StudentInterface has three ...
-1
votes
0answers
22 views
Count the number of occurrences of each symbol in a string array
This calculates the number of occurrences of each symbol in a string array.
I want to find some places in this multithreading code which could lead to a NullPointerException or other exceptions or ...
2
votes
1answer
70 views
Robot Block Command
Problem
We have a robot that can pickup blocks from a stash, move them
horizontally and lower them in place. There are 10 positions available
to lower blocks number 0 to 9. Each position can ...
0
votes
1answer
39 views
A Java Quadrilateral Inheritance Hierarchy - revisited
This is an exercise from Deitel&Deitel's "Java. How to Program (Early Objects)", 10th edition.
9.8 (Quadrilateral Inheritance Hierarchy) Write an inheritance hierarchy for classes Quadrilateral, ...
0
votes
0answers
43 views
Detect the interval between time points
I want to detect the interval between time points. I want to ignore some anomalies if there are. The idea is choose some random samples and try to detect what is the interval between points in most ...
-4
votes
0answers
21 views
Connecting node in a linked list [on hold]
My question is : How can I connect the first node, last node and new node when I add item at the beginning or at any position?
Thanks
...