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
1859public 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 7100suppose 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 4502Post New Java Related AllOther Questions
Why serialization is used in java?
What is web xml java?
What is tight coupling in java?
What is the most important feature of java?
What if I do not provide the string array as the argument to the method?
What is an interceptor in java?
How can one prove that the array is not null but empty?
How do you count in java?
What is java net url?
What is jsr in java?
How long can a lambda function run?
Why is class forname used in java?
What are anonymous methods and lambda expression?
What is flatmap in java8?
What is tier in java?