What are the differences between java’s old java date api and java 8’s date and time api?
No Answer is Posted For this Question
Be the First to Post Answer
What is meant by rest api in java?
What is the java api?
What is Map,List,hashtable,ArrayList and difference between them??
How can you work with permissions from your .net application? : java security
Is java installed on windows 10?
What is dto layer in java?
Why is class forname used in java?
What is an action class in java?
What is the use of servlet in java?
what about jdb and javadoc by example ?
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.
What is data encapsulation?