Ask Question

How to solve "You cannot call a method on a null-valued expression" error

+3
Answers (1)
  1. 20 October, 02:31
    0
    You have an object declared in the function which has a undeclared value.

    Explanation:

    if you will make a variable of class or object in JAVA or other reference typed languages and will not assign the value to it this error occurs.

    For example:

    obj object; / / this line declares a object named variable of type obj class

    Here it will cause same error iff i will do it like:

    obj = object = new obj ();
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “How to solve "You cannot call a method on a null-valued expression" error ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers