How can I have a second string in my HashMap?
The hashmap works with
<String, Double, String>
But not with
Type: Posts; User: jenniferruurs
How can I have a second string in my HashMap?
The hashmap works with
<String, Double, String>
But not with
What does ... mean in this
public Unit(Unit... childeren){
In the code bellow:
What does this ++ do in this method?
protected int frames;
protected int delay;
@Override
public void update()
{
Smart suggestions!
What do I have to return after the the if/else statement in my boolean method?
public class Hoofd {
public static boolean getName(String x)
{
if(x == "jennifer")
...
Why would somebody write a singleton like this (with volatile and synchronized)?
public class Singleton {
private volatile static Singleton singleton;
private Singleton(){}
...
Task :Student.main() FAILED
Exception in thread "main" java.lang.NullPointerException
at demo.Student.setStudents(Student.java:19)
at demo.Student.main(Student.java:28)
FAILURE: Build failed...
Why does my code not work?
package demo;
import java.util.List;
public class Student {
private String naam;
Could somebody explain what this method does do?
public boolean equals(Object object){
if(object instanceof Product){
Product product= (Product)object;
...
I am experimenting with cryptography and I was wondering if somebody has some suggestion how I could improve my code and methodology.
I want my process to generate more securely the cryptography...
It is isolated code.
It is not used, but i don't understand the code itself and why someone would write it like this.
My predecessor (a very experienced Java programmer who has left) has written Java code and I don't understand why he did it that way. Does anyone have an idea when you would like to do something like...
Why does this work:
public class demo {
static int a;
public static void main(String args[]) {
System.out.println(a);
}
}
private static void staticMethod() {
System.out.println("static method");
}
Is there a difference between calling a static method like:
without class name
staticMethod();
What is a shop requirement?
Why would one initialize an array like:
int arr[] = new int[] {1,2,3,4};
Instead of:
int arr[] = {1,2,3,4};
Very often I see in Java code a constructor been used instead of void setColor() method for example.
Why would somebody do this?
So why doing this:
public class Dog {
String color;
...
Bellow I have some code and I was interested in understanding why this method works when it is static? I expected the opposite
public class demo {
int no;
demo(int no){
this.no=no;
}
What does this mean?
static {
cache = new Cache();
}
Does using Final (I know that the final keyword is used as a constant) makes the execution of my code faster?
For example:
int var1 = 98;
versus
final int var1 = 98;
Or is there no...
What should I use instead?
I have the code bellow and I get as output:
30.299999999999997
30
Why is the output:30.299999999999997 and not 30.3?
public class demo {
private static double som(double a, double b) {...