Association in C#The association defines the relationship between an object in C#. An a one-to-one, one-to-many, many-to-one and many-to-many relationship can be defined between objects.For example, An Employee can be associated with multiple projects, whereas a project can have more than one employee.Composition in C#Under Composition, if the parent object is deleted, then the child object also loses its status.The composition is a special type of Aggregation and gives a part-of relationship.For example, A Car has an engine. If the car is destroyed, the engine is destroyed as well.Aggregation in C#Aggregation is a direct relation between objects in C#. It ... Read More
GeneralizationGeneralization is a process of generalizing an entity which contains generalized attributes or properties of generalized entities. The entity that is created will contain the common features. Generalization is a Bottom up process.We can have three sub entities as Car, Truck, Motorcycle and these three entities can be generalized into one general super class as Vehicle.It is a form of abstraction that specifies two or more entities (sub class) having common characters that can be generalized into one single entity (super class) at higher level hiding all the differences.SpecializationSpecialization is a process of identifying subsets of an entity that shares ... Read More
To get the sine of a number, use the JavaScript sine() technique. The sin technique returns a numeric value between -1 and one, that represents the sine of the argumentExampleYou can try to run the following code to get the sine of a number in JavaScript − JavaScript Math sin() Method var value = Math.sin( 0.5 ); document.write("First Value : " + value ); var value = Math.sin( 90 ); document.write("Second Value : " + value );
To get a pseudo-random number between 0 and 1, use the Math.random() method in JavaScript.ExampleYou can try to run the following code to get a pseudo-random number between 0 and 1 − JavaScript Math random() Method var value = Math.random( ); document.write("First Value : " + value ); value = Math.random( ); document.write("Second Value : " + value );
The following is a simple “Hello World” program in C# programming −ExampleLive Demousing System; namespace MyHelloWorldApplication { class MyDemoClass { static void Main(string[] args) { // display text Console.WriteLine("Hello World"); // display another text Console.WriteLine("Welcome!"); Console.ReadKey(); } } }OutputHello World Welcome!Let us see now what all it includes −using System − the using keyword is used to include the System namespace in the program.namespace declaration − A namespace is a collection of classes. The ... Read More
A resizable implementation of the List interface is called ArrayList. It is a non-generic type of collection in C# that dynamically resizes.Let us see how to initialize ArrayList in C# −ArrayList arr= new ArrayList();Add an element like the below-given code snippet −ArrayList arr1 = new ArrayList(); arr1.Add(120); arr1.Add(160);Let us see the complete example to implement ArrayList in C# −ExampleLive Demousing System; using System.Collections; public class MyClass { public static void Main() { ArrayList arr1 = new ArrayList(); arr1.Add(120); arr1.Add(160); ArrayList arr2 = new ArrayList(); ... Read More
The primary purpose of computer networks is to transfer data from a source machine to a destination machine. One of the elementary ways to transfer data between machines is to use removable storage media. The steps for the transfer are −Copy data from the source computer to the removable storage device.Physically transport the removable device to the source computer.Copy data from the removable device to the destination computer.Some of the removable media that can use for transferring data between devices are −Magnetic tapesOptical discs like CDs, DVDs, and Blu-ray DiscsUSB flash drivesZip discs and floppy discsMemory cards and Memory sticksAdvantages ... Read More
Coaxial cables, commonly called coax, are copper cables with metal shielding designed to provide immunity against noise and greater bandwidth. Coax can transmit signals over larger distances at a higher speed as compared to twisted pair cables.Structure of Coaxial CablesCoax has a central core of stiff copper conductor for transmitting signals. This is covered by an insulating material. The insulator is encased by a closely woven braided metal outer conductor that acts as a shield against noise. The outer conductor is again enclosed by a plastic insulating cover. The structure is shown in the following figure −Categories of Coaxial CablesCoaxial ... Read More
The “this” keyword in C# is used to refer to the current instance of the class. It is also used to differentiate between the method parameters and class fields if they both have the same name.Another usage of “this” keyword is to call another constructor from a constructor in the same class.Here, for an example, we are showing a record of Students i.e: id, Name, Age, and Subject. To refer to the fields of the current class, we have used the “this” keyword in C# −public Student(int id, String name, int age, String subject) { this.id = id; ... Read More
The Deque class uses a doubly-linked list to implement its collection of elements. The doubly-linked lists should have two nodes i.e. front and back nodes. This helps in adding elements on the front and back of the Deque.With the Deque class, you have the ability to add and remove elements from both the sides. This is why Deque is said to be a double-ended queue.The Deque class has the following methods in the Queue class −ClearClears the collection of all of its elementsContainsWhether or not an object is in the collectionToArrayUse the ToArray() method to copy all of the elements ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP