Question: C# Programming: Question: Identify (a) Instance Members(b) Class/Static Member How can you access/call static and non-static members from main () function? using System; namespace Volume
C# Programming:
| Question: Identify (a) Instance Members(b) Class/Static Member How can you access/call static and non-static members from main () function? |
using System; namespace Volume { class Vol { private double length; private double height; public static double volume; public void setLength(double len) { length = len; } public void setHeight(double hei) { height = hei; } public double getVolume() { volume = length * height; return volume; } public static void printVolume() { Console.WriteLine("Volume = " + volume); } } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
