public class awah{
private int x=0;
private int y;
private int w;

public awah(int width){
public void sety(){

public int gety(){
return y;

public void setx (){

public int getx(){
return x;

public void showUpdate(){

}//end of awah

public static void main(String[] args){
    awah m  = new awah(5);

I expected the update to show the updated value of x+y but it doesn't
I want to be able to update the variable x whenever y is set to some random number

Line 10, do you have your own implemented of class Int? It should be int, not Int. Remember that all variable/class names Java are case-sensitive.

PS: You have not done anything with the variable you created in your main() but expect the value to be updated???

Be a part of the DaniWeb community

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