Question: Please answer the following questions are question relating to java. 1. Declare a string variable: String s1 = new String(hello); Will the following two statements
Please answer the following questions are question relating to java.
1. Declare a string variable: String s1 = new String(hello); Will the following two statements return true or false? Why?
s1.equals(hello)
s1 == hello
2. Whats the difference between non-static method and static method?
3. About argument promotion and casting, whats the promotion rule?
4. When and why do we need a Random object with a seed value?
5. What is Shadowing in Scope of Declaration? How to call shadowed variable in the main method?
6. What is method overloading?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
