What is the difference between a local variable and an instance variable?

What will be an ideal response?


A local variable is declared in the body of a method and can be used only from the point at which it’s declared through the end of the method declaration. An instance variable is declared in a class, but not in the body of any of the class’s methods. Also, instance variables are accessible to all methods of the class.

Computer Science & Information Technology

You might also like to view...

Which of the following is true about backing up and recovering the VMM environment?

A. you use the VMM administrator console to backup the SQL database B. you use the Failover Cluster Manager to backup the library server C. the VMM server is backed up using the VMM administrator console D. you cannot perform a full server backup to a network folder

Computer Science & Information Technology

In a Microsoft Excel worksheet, you can add a header and footer by clicking the _____.?

A. ?Page Layout button B. ?Page Break button C. ?Review tab D. ?Format tab

Computer Science & Information Technology

The NPER

A) is a word or a string of characters that represent one or more cells. B) a set of range names. C) is the total number of payment periods. D) the present value of the loan.

Computer Science & Information Technology

HTML documents are:

a. encrypted and compressed data files b. simple ASCII text files c. complex Unicode-encoded files d. word processing files with intact text formatting e. streaming packet-data structures

Computer Science & Information Technology