Difference Between Class and Object in C#

karthikeya Boyini
Updated on 20-Jun-2020 12:58:55

346 Views

When you define a class, you define a blueprint for a data type.Objects are instances of a class. The methods and variables that constitute a class are called members of the class.To access the class members, you use the dot (.) operator after the object name. The dot operator links the name of an object with the name of a member for example, Box Box1 = new Box();Above you can see Box1 is our object. We will use it to access the members −Box1.height = 7.0;You can also use it to call member functions −Box1.getVolume();The following is an example showing ... Read More

Check MySQL Tables in Current Database with Table Type

V Jyothi
Updated on 20-Jun-2020 12:58:01

147 Views

It can be done with the SHOW FULL TABLES statement. Its Syntax would be as follows −SyntaxSHOW FULL TABLESExampleIn the following example our current database is ‘query’ hence the statement below will show us the table list along with table type in the result set from this database −mysql> SHOW FULL TABLES; +-----------------------------+------------+ | Tables_in_query             | Table_type | +-----------------------------+------------+ | accounts                    | BASE TABLE | | address                     | BASE TABLE | | cars     ... Read More

Differences Between Constructors and Destructors in C#

Ankith Reddy
Updated on 20-Jun-2020 12:57:24

559 Views

ConstructorsA class constructor is a special member function of a class that is executed whenever we create new objects of that class.A constructor has exactly the same name as that of class and it does not have any return type.Constructor has the same name as the class name −class Demo {    public Demo() {} }The following is an example −Example Live Demousing System; namespace LineApplication {    class Line {       private double length; // Length of a line       public Line() {          Console.WriteLine("Object is being created");   ... Read More

Check MySQL Tables in a Different Database

vanithasree
Updated on 20-Jun-2020 12:57:10

119 Views

It can be done with the SHOW FULL TABLES statement. Its Syntax would be as follows −SyntaxSHOW FULL TABLES FROM db_nameHere, db_name is the name of the database from which we want to see the list of tables.ExampleWe are currently using the database named ‘query’ and the MySQL query below will show us the list of tables along with table type from the database named mysql.mysql> SHOW FULL TABLES FROM mysql; +---------------------------+------------+ | Tables_in_mysql           | Table_type | +---------------------------+------------+ | arena                     | BASE TABLE | | ... Read More

List MySQL Databases Using SQL Query

Nitya Raut
Updated on 20-Jun-2020 12:56:32

148 Views

With the help of following MySQL query, we can see the list of MySQL database −mysql> SELECT schema_name FROM information_schema.schemata; +--------------------+ | schema_name        | +--------------------+ | information_schema | | gaurav             | | mysql              | | performance_schema | | query              | | query1             | | sys                | | tutorials          | +--------------------+ 8 rows in set (0.00 sec)We can also use WHERE clause with this query as follows −mysql> SELECT schema_name FROM information_schema.schemata WHERE schema_name LIKE '%schema' OR schema_name LIKE '%s'; +--------------------+ | schema_name        | +--------------------+ | information_schema | | performance_schema | | sys                | | tutorials          | +--------------------+ 4 rows in set (0.00 sec)

Use of CHECK TABLE Statement in MySQL

Jennifer Nicholas
Updated on 20-Jun-2020 12:54:54

176 Views

There may be something wrong which can happen to the database server e.g., the server was shutdown unexpectedly, error while writing data to the hard disk, etc. These situations could make the database operate incorrectly and in the worst case, it can be crashed.With the help of CHECK TABLE statement MySQL allows us to check the integrity of database tables. Its syntax would be as follows −CHECK TABLE table_nameHere, table_name is the name of the table.ExampleWe are running this statement for the table Student_info as follows −mysql> CHECK table student_info\G *************************** 1. row ***************************    Table: query.student_info       ... Read More

Differences Between ref and out Parameters in C#

karthikeya Boyini
Updated on 20-Jun-2020 12:54:41

637 Views

Ref ParameterA reference parameter is a reference to a memory location of a variable. When you pass parameters by reference, unlike value parameters, a new storage location is not created for these parameters.You can declare the reference parameters using the ref keyword. The following is an example −Example Live Demousing System; namespace CalculatorApplication {    class NumberManipulator {       public void swap(ref int x, ref int y) {          int temp;          temp = x; /* save the value of x */          x = y; /* put ... Read More

Differences Between Class Methods and Class Members in C#

George John
Updated on 20-Jun-2020 12:52:50

1K+ Views

A member function i.e. method of a class is a function that has its definition or its prototype within the class definition similar to any other variable. It operates on any object of the class of which it is a member, and has access to all the members of a class for that object.The following is an example −public void setLength( double len ) {    length = len; } public void setBreadth( double bre ) {    breadth = bre; }The following is an example showing how to access class member functions in C# −Example Live Demousing System; ... Read More

ANALYZE TABLE Statement for MySQL Table Maintenance

Daniol Thomas
Updated on 20-Jun-2020 12:52:36

381 Views

MySQL query optimizer is an important element of the MySQL server that makes an best question execution set up for a query. For a particular query, the query optimizer uses the stored key distribution and other factors to decide the order in which tables should be joined when you performing the join, and which index should be used for a specific table.However, the key distributions can be sometimes inaccurate e.g., after you have done a lot of data changes in the table including insert, delete, or update. IIf the key distribution isn't correct, the question optimizer could pick a nasty ... Read More

Use of OPTIMIZE TABLE Statement in MySQL

Nikitha N
Updated on 20-Jun-2020 12:51:37

220 Views

While working with the database, we have a tendency to do plenty of changes like insert, update and delete data within the table which will cause the physical storage of the table fragment. As a result, the performance of database server is degraded.MySQL provides us with OPTIMIZE TABLE statement that allows you to optimize the table to avoid this defragmenting problem. Its syntax would be as follows −OPTIMIZE TABLE table_nameHere, table_name is the name of the table.ExampleWe are running this statement for the table Student_info as follows −mysql> Optimize table student_info\G *************************** 1. row ***************************    Table: query.student_info       Op: ... Read More

Advertisements