how assign a none static var to a static var in Java/Android?

String top5=scoreSaveReturn2(this.x);
public static String totalPoints3;//=top5;
CannonGame.totalPoints3=top5;  // gives error here

In a Canvas game if we have a class like:

public class CannonView extends SurfaceView 
implements SurfaceHolder.Callback

how transfer from this a var value to this

public class CannonGame extends Activity

without using static vars?

Try using new, as in totalPoints3=new String(top5)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.