Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
static
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { class StaticDemo { public static int Val =100; public static int ValDiv2() { return Val/2; } } public class Program { public static void Main(string[] args) { //Your code goes here Console.WriteLine("Применение ключевого слова static"); Console.WriteLine("_________________________________"); Console.WriteLine(); Console.WriteLine("Начальное значение переменой Val = {0}", StaticDemo.Val); Console.WriteLine("Переменная инициализируется до создания любого объекта ее класса"); StaticDemo.Val = 50; Console.WriteLine("Теперь значение переменой Val = {0}", StaticDemo.Val); Console.WriteLine("Переменная, после вызова статического метода = {0}", StaticDemo.ValDiv2()); Console.WriteLine(); Console.WriteLine("_________________________________"); Console.WriteLine("В методе static можно вызывать только другой метод static"); } } }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Naju Date Format Issue
first VB code
x=msgbox("Your Message Here", Button+Icon, "Your Title Here")
pass-len-to-predicate-modified
Math 5.85a
UrlDecode
math 10.98
Putting In-Between Symbols
jjj3
edmond@DESKTOP-M2BC2LH
Please log in to post a comment.