0

Hi everyone!i am beginner in java,i have write a program but i can compile it successfully can any one help me please...te code is

package sensor;


public class sensor {

	private String Id;
	private int Kordx;
	private int Kordy;
	private char[] getId;
	
	
	
	public static void main(String[] args) {
	sensor ob=new sensor ("first",1,1);
	System.out.println(ob.getId);
	System.out.println(ob.getKordx() + ob.getKordy());
	
	ob.setKordx(2);
	ob.setKordy(2);
	ob.setId("second");
	System.out.println(ob.getId);
	System.out.println(ob.getKordx() + ob.getKordy());
	

	}
public sensor (String id,int kordx,int kordy)
{
Id=id;
Kordx=kordx;
Kordy=kordy;

}
public String getId()
{
	return Id; 
}
public void setId (String id )
{
	Id=id;
}

public int getKordx()
{
	return Kordx;
}
public void setKordx (int kordx )
{
	Kordx=kordx;
}
public int getKordy()
{
	return Kordy;
}
public void setKordy (int kordy )
{
	Kordy=kordy;
}
}

I am waiting for your help
regards dhija22

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by JamesCherrill
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.