Java - Factorial
Java |
https://codedump.io/share/l0XXajVMwiiM
|
I am printing the factorial of the first 10 numbers, so it is 0 - 9. The below code works for me. But I am unable to make the loop such that the facto...
4 years ago
Java JOptionPane
Java |
https://codedump.io/share/0hIqNgQ8rAMZ
|
I'm creating a Tic Tac Toe GUI based game in Java and am struggling with using 2D arrays with JOptionPane. So far I have been able to create the butto...
4 years ago
Java Serializable
Java |
https://codedump.io/share/CNNvqG091OSQ
|
i have made a serialized class,like this
`
class Example implements Serializable
{
transient byte i=2;
transient byte j=3;
Example(){Sys...
3 years ago
Java: InvocationTargetException
Java |
https://codedump.io/share/eoUfVK7ZKPnX
|
I am dynamically creating classes in Java and trying to invoke methods in them, however, sometimes I get a java.lang.reflect.InvocationTargetException...
3 years ago
Java 8 and Java time
Java |
https://codedump.io/share/V6riwallJqvi
|
I know the default Java library for Codename One is now Java 8 and I am also compiling locally with Java 8.
I am trying to use the new java.time API...
4 years ago
Java String.toUpperCase()
Java |
https://codedump.io/share/4PPCQ8Z0MtZw
|
Just the other day I ran into a strange strange bug. I had a string of characters that I had to build. And as a delimiter the host system I was commun...
4 years ago
Java InstantiationException
Java |
https://codedump.io/share/fahEdRi39aB
|
I made a class to implement an interface and was testing it using another class.
This is the class that I created.
public class MyWeaponI implement...
4 years ago
Java Exceptions
Java |
https://codedump.io/share/luThz8rU1Twg
|
I am practicing for my java oracle certification test and found this in one of the oracle sample questions. I am not sure why the answer is A and need...
4 years ago
Java - ArrayIndexOutOfBoundsException
Java |
https://codedump.io/share/CdNpst1iwtCr
|
I am working on a java program that generates random numbers and then puts them in an array. Then the program is supposed to go through the array, put...
4 years ago
Java Constructors
Java |
https://codedump.io/share/rDhpcBBRsIaQ
|
I am trying to learn how to specify class constructors in Java. I am starting to understand that they specify the types of instance variables of objec...
4 years ago
Java: Skydiving
Java |
https://codedump.io/share/5DOS0lxwVszI
|
Sorry for lack of details, I made a few edits.
I've got a problem in my java class that I can't wrap my head around.
I need to make a program that d...
3 years ago
Java generics
Java |
https://codedump.io/share/LtrYgXJgPwNx
|
Is it possible to make a method that will take anything, including objects, Integers etc? I have a method checking the value if it is null and I was t...
4 years ago
Java BigDecimal.round()
Java |
https://codedump.io/share/r4vt5GnWYlNc
|
I am trying to round a BigDecimal value to the nearest 1000 using the below code
BigDecimal oldValue = new BigDecimal("791232");
BigDecimal newValue...
3 years ago
java - Thread.sleep
Java |
https://codedump.io/share/SNKHx4meUSoW
|
In the code and output below, t2 doesn't start until t1 finishes. Shouldn't they work parallel? Is Thread.sleep() affect whole process?
public class ...
3 years ago
Java .class.getResourceAsStream()
Java |
https://codedump.io/share/GH04JWiKGocA
|
To the best of my knowledge, Class.getResourceAsStream() gets an InputStream directed at a file within the .jar file? If I'm wrong about this, please ...
3 years ago
Java: Graphics2D
Java |
https://codedump.io/share/vzXkeau4HpMM
|
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class SimpleGui3C implements ActionListener {
JFrame frame;
public static ...
4 years ago
Java Annotations
Java |
https://codedump.io/share/bLImitcw7QN8
|
What is the purpose of annotations in Java? I have this fuzzy idea of them as somewhere in between a comment and actual code. Do they affect the progr...
4 years ago
Java PropertyChangeListener
Java |
https://codedump.io/share/z5CI5NYqNR4H
|
I'm trying to figure out how to listen to a property change in another class. Below is my code:
ClassWithProperty has the property I want to listen t...
3 years ago
java palindrome
Java |
https://codedump.io/share/bwj7z1qmKhgp
|
boolean checkPalindrome(String inputString) {
int j=0;
for(int i=0;i<inputString.length();i++)
{
j=inputString.length()-1;
if(inputString.c...
3 years ago
Java almostIncreasingSequence
Java |
https://codedump.io/share/OceaInNjd8gK
|
Okay so i just started out on CodeFight, I got this question:
After a couple of hours of trying to figure a way by myself to solve it i got it fully...
3 years ago