Untitled

mail@pastecode.io avatar
unknown
plain_text
25 days ago
426 B
1
Indexable
Never
class Dog{
	String breed;
	String color;
	private String size = "large";
	static int age =5;
	static int 	sum;
	//static
	{
		for(int i=0;i<3;i++)
			sum+=i;
			System.out.println(sum);
	}
	public String getInfo() {
		return ("Breed is:"+breed+"Size is:"+size);
	}
}



public class staticdog {

	public static void main(String[] args) {
		Dog dog2=new Dog();
		System.out.println(Dog.sum);

	}

}
Leave a Comment