What is a bean class?
No Answer is Posted For this Question
Be the First to Post Answer
public class Dog { private int weight; public int getweight(){ return weight; } public void SetWeight(int newWeight){ if (newWeight > 0){ weight = newWeight; } } } public class TestDog { public static void main(String[] args) { Dog d = new Dog(); System.out.println("Dog d's weight is " + d.getWeight()); d.setWeight(42); System.out.println("Dog d's weight is " + d.getWeight()); d.setweight(-42); System.out.println("Dog d's weight is " + d.getWeight()); } } class dog is compiled but there is an error in class TestDog when compiled and the error is with dot notations. I want to kmow why there is error in testdog class when compiled.
Which is best framework in java?
What is an action class in java?
When is static variable loaded? Is it at compile time or runtime? When exactly a static block is loaded in java?
how can program polindrome using java
What do you understand by casting in java language? What are the types of casting?
What is javacpl?
What is stateless class in java?
What are the disadvantages of java sockets?
What is loose coupling in java?
What are the advantages of java sockets?
When a thread is created and started, what is its initial state?