About 50 results
Open links in new tab
  1. java - How to write an .add () method? - Stack Overflow

    Mar 13, 2013 · My second problem lies with creating a method add (). About your "add" method, you probably want to change your local variables to be something more "descriptive", it will help …

  2. How to correctly use the add method in Java? - Stack Overflow

    You need to learn about basic Java syntax. You are trying to add a string with the contents Rectangle into the list, not a Rectangle object. You should assign your new Rectangle() to a variable and use that.

  3. Java Linked List - add method - Stack Overflow

    Data structures class, implementing a singly linked-list with head, tail and current nodes. Having trouble with a method, could use a nudge in the right direction. From the assignment, write the m...

  4. An add method to add objects in your custom java class

    Feb 21, 2014 · A simple question on Java class I want to create my class with my own add method which adds an object of a different class. For eg if my class name is Weapon, I want to create an add …

  5. Difference between set and add methods in list in java

    Apr 17, 2021 · Your problem is, you are trying to set a value in a non-existing index. To understand the case you should know the basic difference: set () Parameters The set () method takes two …

  6. Adding a method to an existing object instance in Python

    How do I add a method to an existing object (i.e., not in the class definition) in Python? I understand that it's not generally considered good practice to do so, except in some cases.

  7. Java List.add() method - Stack Overflow

    Oct 11, 2014 · Below is the method add() of Java List Interface; if I loop through it 7 times adding i to the 0 th position like so.

  8. Java adding to an integer using methods - Stack Overflow

    Apr 8, 2014 · I am having trouble with a relatively simple problem: I am trying to use a method from another class to add to an integer in my main class but the value of my integer is not increasing, the …

  9. Java add() method convention - Stack Overflow

    Jun 18, 2010 · So, I'm normally a ruby programmer, so my grasp of Java conventions is shaky at best. If I have a class A and want to define a method to add two instances of that class, what's the …

  10. How do I override List<T>'s Add method in C#? - Stack Overflow

    Mar 19, 2016 · 44 First, you can't override Add and still have polymorphism against List, meaning that if you use the new keyword and your class is cast as a List, your new Add method won't be called. …