when i send the request to the JSP page it will print as it is and why? and how to solve this problem please inform me that solution
1874public 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.
3 7137suppose we have one String s="india is my country"; now we get the o/p "like country my is India". what is the logic?
2 4532Post New Java Related AllOther Questions
How do I find jre version?
What is default constructor in java?
What is the difference between collection and stream?
What is optional in java 8? What is the use of optional?advantages of java 8 optional?
Explain the inheritance principle.
What is xml file in java?
What are tags in java?
How can one prove that the array is not null but empty?
Explain issues of old java date api?
What is the use of jprofiler?
What is the use of servlet in java?
Who developed rxjava?
Why is javac not recognized?
What is type inference? Is type inference available in older versions like java 7 and before 7 or it is available only in java se 8?
What is explicit casting?