[Solved] Uppdating a variable [closed]

in class 1 create a method like this public void Update() { // Put logic here to update position for your ball on the curve. } Call update from class 2 when you increment the time. private void Timer1_Tick(object sender, EventArgs e) { Class1.Update(); a += 1 } 1 solved Uppdating a variable [closed]

[Solved] unexpected type; required: variable; found: value

Change this line. if(yearPublished=0&monthPublished=0){ return (“Published: “+”invalid number”); to if(yearPublished == 0 && monthPublished == 0){ return (“Published: “+”invalid number”); I imagine you are now getting your second, unreachable return, error due to you having an else statement above this block of code, which is called when your conditions in your if-else if loops are … Read more

[Solved] JAVA variable as 2 types [closed]

Java does not support union types; however, both of these types share the same base Object class, so you could assign either one of them to a variable defined like this Object something; something = “Hello World!”; something = new ArrayList(); // this is a collection. Odds are that you probably were thinking of a … Read more

[Solved] Accessing scope of a variable once declared outside class

import java.util.Arrays; public class Kata { public static int findShort(String s) { int shortestLocation = null; this ^^ line needs to be initialized to an integer… not ‘null’ 0 is fine String[] words = s.split(“”); int shortestLength=(words[0]).length(); for(int i=1;i<words.length;i++){ your problem starts here ^^ you never iterate through all of the words as you stop … Read more

[Solved] Variables to next activity [duplicate]

Pass value of string to Activity2: button.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { String a = editText.getText().toString(); String b = editText2.getText().toString(); Intent intent = new Intent(your_activity.this, Activity2.class); intent.putExtra(“a_value”, a); intent.putExtra(“b_value”, b); startActivity(intent); } }); Retrieve the value in 2nd Activity: public String user1; public String user2; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); … Read more

[Solved] Passing returned jquery var to another jquery

EDIT: I cleaned up my answer a little bit, should be a bit more readable. You just need to break up your string and concatenate it with the returned value. jQuery(document).ready(function() { var $parent = jQuery(parent.document); // cache this so jquery doesnt have to instantiate the same object twice var theFormID = $parent .find(‘.theformclass’) .find(‘input[name=”form_id”]’).val(); … Read more

[Solved] php variable changes when clicked on html link [closed]

Try this, is PHP: <?php if (isset($_GET[‘money’])) { $money = rob_shop($_GET[‘money’]); echo ‘You now have: ‘.$money.'<br>’; } else { $money = 100; echo ‘You now have: ‘.$money.'<br>’; } echo ‘<a href=”https://stackoverflow.com/questions/27303586/?money=”.$money .'”>rob a shop</a>’; function rob_shop($money){ $money = $money + 75; return $money; } ?> But the best way to do it is with ajax … Read more

[Solved] Global variables, member variables and instance variables in Python [closed]

You have asked a lot of questions under one! I will try to answer each of those 🙂 Variables – global vs local global variables are those ones whose scope is global, i.e. available in entire program. local variables by contrast are those ones which resides in one particular scope, a function, inside a loop, … Read more