What is the difference between a jdk and a jvm?
No Answer is Posted For this Question
Be the First to Post Answer
What happens when the parent process of a child process exits before the child ?
Is it correct to say that using parentheses can only change?
What is reflection in java?
What are jpa annotations?
Write a program using call by refernce for two different classes to explain to print whether a given number is automorphic or not.
Do I need to install jre if I have jdk?
What is meant by framework in java?
What is the most important feature of java?
How do I download and install eclipse on windows 10?
What is lsdou? : java security
Define network programming?
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.