About 119,000 results
Open links in new tab
  1. Java Modifiers - W3Schools

    We divide modifiers into two groups: For classes, you can use either public or default: The class is only accessible by classes in the same package. This is used when you don't specify a modifier. You will learn more about packages in the Packages chapter. For attributes, methods and constructors, you can use the one of the following:

  2. Java changing value of a variable through a method?

    May 12, 2013 · Java use pass by value so you can't pass in a primitive and modify the primitive value. You could pass in an array on integers and then modify the integers in the array or return a different integer. –

  3. Modifying Objects Within Stream While Iterating | Baeldung

    Dec 5, 2023 · Discover the common mistakes made while modifying the elements in a Java Stream and the correct way to do it.

  4. java - how to update variables, passed to a method ... - Stack Overflow

    Dec 15, 2011 · 1) You can either make the "mee" variable a static, global variable, and edit it anywhere or 2) You can edit the "moo" method to RETURN an integer, and set the mee method to that returned value.

  5. Modifying each item of a List in java - Stack Overflow

    Nov 15, 2013 · Here is how you do it correctly: final String element = i.next(); i.set(element + "yaddayadda"); The iterator is the one that needs to modify the list as it is the only one that knows how to do that properly without getting confused about the list elements and order. Edit: Because I see this in all comments and the other answers:

  6. Access Modifiers in Java - GeeksforGeeks

    Apr 7, 2025 · Understanding default, private, protected, and public access modifiers is essential for writing efficient and structured Java programs. In this article, we will explore each modifier with examples to demonstrate their impact on Java development. There are 4 types of access modifiers available in Java: 1. Default Access Modifier.

  7. Java Modifiers Explained For Beginners - Medium

    Feb 28, 2024 · Modifiers are keywords that you attach to classes, methods, or variables to change their attributes or behavior. The goal of this guide is to explain Java modifiers for beginners, breaking...

  8. How to Modify Variable Values within Methods in Java

    In Java, you can modify variable values within methods using parameter passing, scope management, and class attributes. Understanding how to effectively manipulate variable values is essential for functional programming and data management.

  9. String Modifying Methods in Java - Java Guides

    Java provides several methods to modify strings, each serving different purposes and use cases. The substring() , concat() , replace() , replaceAll() , replaceFirst() , toUpperCase() , toLowerCase() , trim() , and split() methods offer a wide range of functionality for string manipulation.

  10. Java Modifier Types - Online Tutorials Library

    Explore the different types of modifiers in Java including access modifiers, non-access modifiers, and their significance in Java programming.

  11. Some results have been removed