madash5283 madash5283
  • 16-07-2019
  • Computers and Technology
contestada

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

Respuesta :

SaniShahbaz
SaniShahbaz SaniShahbaz
  • 24-07-2019

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();

Answer Link

Otras preguntas

In addition to building grand palaces, in what other ways did absolute rulers use the vast wealth they accumulated
Ian batting sold a computer for $255 that originally cost him $1,200. what was ian's percent of decrease based on the cost of the computer?
Number 22 I need the formula asap
Jason is filling his circular pool with water. The diameter is 14 feet. If it takes an hour for the water to rise 6 inches, how long will it take to fill the po
if b is between a and c then ab+bc=ac
The main reason why puritan settled in North America was to ? A. Become fur trappers B. Gain political power C. Find religious freedom D. Trade for raw mate
Coral reefs are made of
What is the solution to the inequality? 4 ( 2x + 5 ) − 2x ≥ 10
Solve the equation: x2 + 5x − 2 = 0
If real gdp in a particular year is $80 billion and nominal gdp is $240 billion, the gdp price index for that year is: