what does static do code example

Example 1: static in java

static keyword is a non-access modifier. static keyword can be used with 
class level variable, block, method and inner class or nested class.

Example 2: static in java

The static keyword in Java is used for memory management mainly. We can apply static keyword with
variables, methods, blocks and nested classes. The static keyword belongs to the class 
  than an instance of the class.

The static can be:

Variable (also known as a class variable)
Method (also known as a class method)
Block
Nested class

Example 3: static

Static is a keyword in C++ used to give special characteristics to an element. Static elements are allocated storage only once in a program lifetime in static storage area. And they have a scope till the program lifetime. Static Keyword can be used with following,

Static variable in functions
Static Class Objects
Static member Variable in class
Static Methods in class

Example 4: static

$ sudo nmcli connection show enp0s3...connection.id: enp0s3connection.uuid: a6fc257b-5894-4437-a35e-382c06b27e46connection.stable-id: --connection.type: 802-3-ethernetconnection.interface-name: enp0s3connection.autoconnect: yes...ipv4.method: auto...IP4.ADDRESS[1]: 10.0.2.15/24IP4.GATEWAY: 10.0.2.2IP4.ROUTE[1]: dst = 0.0.0.0/0, nh = 10.0.2.2, mt = 100IP4.ROUTE[2]: dst = 10.0.2.0/24, nh = 0.0.0.0, mt = 100IP4.DNS[1]: 10.0.1.1

Tags:

Cpp Example