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
1427public 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 6028suppose 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 3476Post New Java Related AllOther Questions
What is a delimiter in java?
How do I run a java project?
What is java bean class?
What is a static method?
What is difference between map and flatmap in java 8?
What is jsr in java?
Do I really have to type in the programs in the book to try them out?
What is setstring method in java?
What are microservices in java?
What if I write static public void instead of public static void?
What is static class in java?
If you’re overriding the method equals() of an object, which other method you might also consider?
What is an action class in java?
Define network programming?
What is interceptor in java?