Search:

Type: Posts; User: jenniferruurs

Search: Search took 0.13 seconds.

  1. How can I have a second string in my HashMap?

    How can I have a second string in my HashMap?
    The hashmap works with



    <String, Double, String>


    But not with
  2. Replies
    0
    Views
    861

    What does ... mean?

    What does ... mean in this



    public Unit(Unit... childeren){


    In the code bellow:
  3. Replies
    1
    Views
    728

    What does this ++ do here?

    What does this ++ do in this method?



    protected int frames;
    protected int delay;

    @Override
    public void update()
    {
  4. Re: What to return after in this boolean method with the if/else statement?

    Smart suggestions!
  5. What to return after in this boolean method with the if/else statement?

    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")
    ...
  6. Why would somebody write a singleton like this?

    Why would somebody write a singleton like this (with volatile and synchronized)?



    public class Singleton {
    private volatile static Singleton singleton;

    private Singleton(){}
    ...
  7. Replies
    4
    Views
    617

    Re: Why does my code not work?

    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...
  8. Replies
    4
    Views
    617

    Why does my code not work?

    Why does my code not work?



    package demo;

    import java.util.List;

    public class Student {
    private String naam;
  9. Replies
    1
    Views
    560

    What does this method do?

    Could somebody explain what this method does do?



    public boolean equals(Object object){
    if(object instanceof Product){
    Product product= (Product)object;
    ...
  10. I want my process to generate more securely the cryptography process if that is possible

    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...
  11. Replies
    5
    Views
    682

    Re: Comments on this code?

    It is isolated code.
    It is not used, but i don't understand the code itself and why someone would write it like this.
  12. Replies
    5
    Views
    682

    Comments on this code?

    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...
  13. Why can I have static int a, but not int a?

    Why does this work:


    public class demo {
    static int a;
    public static void main(String args[]) {
    System.out.println(a);
    }

    }
  14. Is there a difference between calling a static method

    private static void staticMethod() {
    System.out.println("static method");
    }

    Is there a difference between calling a static method like:

    without class name

    staticMethod();
  15. Replies
    3
    Views
    814

    Re: initialize an array

    What is a shop requirement?
  16. Replies
    3
    Views
    814

    initialize an array

    Why would one initialize an array like:

    int arr[] = new int[] {1,2,3,4};

    Instead of:

    int arr[] = {1,2,3,4};
  17. Replies
    1
    Views
    1,059

    Why getMethod, but not set method

    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;
    ...
  18. Replies
    1
    Views
    681

    Why is the swap method static?

    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;
    }
  19. Replies
    3
    Views
    1,198

    What does this line in the code mean?

    What does this mean?



    static {
    cache = new Cache();
    }
  20. Does using Final makes the execution of my code faster?

    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...
  21. Re: Why is the som of this these two not correct

    What should I use instead?
  22. Why is the som of this these two not correct

    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) {...
Results 1 to 22 of 22