About 604,000 results
Open links in new tab
  1. Set and Get Methods in java? - Stack Overflow

    Jul 10, 2011 · Set and Get methods are a pattern of data encapsulation. Instead of accessing class member variables directly, you define get methods to access these variables, and set …

  2. When to use get/set Methods in java - Stack Overflow

    Jul 29, 2014 · Strictly speaking, the use of 'get'/'set' as part of the method name is a hold over from JavaBean spec. It is actually unnecessary, as the get or set nature of a method can be …

  3. java - Getting an element from a Set - Stack Overflow

    Aug 19, 2016 · Default Set in Java is, unfortunately, not designed to provide a "get" operation, as jschreiner accurately explained. The solutions of using an iterator to find the element of …

  4. java, get set methods - Stack Overflow

    Mar 19, 2016 · To understand get and set, it's all related to how variables are passed between different classes. The get method is used to obtain or retrieve a particular variable value from …

  5. Get and Set methods in Java. How do they work? - Stack Overflow

    Apr 2, 2012 · There's nothing "automatic" in Java almost ever: the only way a constructor parameter value gets set to an instance value is if the instance value is if the constructor sets …

  6. java - Is there a way to automatically generate getters and setters …

    The best way I ever used to generate getters and setters automatically is using project lombok annotations in your java project, lombok.jar will generate getter and setter method when you …

  7. Creating subset of a Set in Java - Stack Overflow

    I have a LinkedHashSet, i.e an ordered set. I'm trying to find a function to just return a subset of the set, i.e the first 20 elements of the set. I know I can do it by creating a new set and then …

  8. java - Are static setter/getters allowed? - Stack Overflow

    Nov 18, 2011 · and you can access this object using get/set method. public static String getString(){ return abc; } public static void setString(String newAbc){ abc = newAbc; } and you …

  9. java - How to get an element from a Set? - Stack Overflow

    Nov 5, 2013 · The set of integers represents equivalent states (integers) in a deterministic finite automaton. I am writing a method to minimize an unoptomized automaton. Near the end of this …

  10. Diferença de Set e Get em programação orientada a objeto

    Jul 11, 2017 · Pode ser visto como é diferente em Java. Eles podem ser usados separadamente. De fato é comum ter um get e não um set. Em alguns caso o set fica privado ou protegido …

Refresh