Ask Question
20 September, 21:13

a. Is there any functional difference between the class being instantiated in the following two ways? Balanced bal = new Balanced ("abc", "xyz"); Balanced bal = new Balanced ("cab", "zxy"); b. Is there any functional difference between the class being instantiated in the following two ways? Balanced bal = new Balanced ("abc", "xyz"); Balanced bal = new Balanced ("abc", "zxy"); c. Is there any functional difference between the class being instantiated in the following two ways? Balanced bal = new Balanced ("abc", "xyz"); Balanced bal = new Balanced ("xyz", "abc"); d. What type is pushed onto the stack? A char? An int? An integer? explain. e. Under which circumstances is the first opeation performed on the stack (not counting the new operation) the top operation? f. What happens if the string expression, that is passed to the test method, is an empty string?

+1
Answers (1)
  1. 20 September, 23:45
    0
    A, B, C - NO

    D-Value type like int, char ...

    E. pop

    D. it throws null exception

    Explanation:

    (A, B, C) There is no functional difference but as the values passed to the parameterized constructor is different so you will get different outputs but functionality of the class didn't change

    (D) stack is a data structure which stores value types where as heap stores object types. In. stack actual value of the variable stored and heap address of the object stored

    (E) the top operation on stack is always pop once we inserted the elements in a stack. if there are no elements in stack pop results null

    (D) if the string we passed is null or empty to the test method it returns exception we need to handle that
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “a. Is there any functional difference between the class being instantiated in the following two ways? Balanced bal = new Balanced ("abc", ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers