
- C# Basic Tutorial
- C# - Home
- C# - Overview
- C# - Environment
- C# - Program Structure
- C# - Basic Syntax
- C# - Data Types
- C# - Type Conversion
- C# - Variables
- C# - Constants
- C# - Operators
- C# - Decision Making
- C# - Loops
- C# - Encapsulation
- C# - Methods
- C# - Nullables
- C# - Arrays
- C# - Strings
- C# - Structure
- C# - Enums
- C# - Classes
- C# - Inheritance
- C# - Polymorphism
- C# - Operator Overloading
- C# - Interfaces
- C# - Namespaces
- C# - Preprocessor Directives
- C# - Regular Expressions
- C# - Exception Handling
- C# - File I/O
- C# Advanced Tutorial
- C# - Attributes
- C# - Reflection
- C# - Properties
- C# - Indexers
- C# - Delegates
- C# - Events
- C# - Collections
- C# - Generics
- C# - Anonymous Methods
- C# - Unsafe Codes
- C# - Multithreading
- C# Useful Resources
- C# - Questions and Answers
- C# - Quick Guide
- C# - Useful Resources
- C# - Discussion
LinkedList AddLast method in C#
Declare a string array.
string [] students = {"Jenifer","Angelina","Vera"};
Add it to a LinkedList.
string [] students = {"Jenifer","Angelina","Vera"};
Now, use AddLast() method to add a node at the end.
list.AddLast("Anne");
Example
using System; using System.Collections.Generic; class Demo { static void Main() { string [] students = {"Jenifer","Angelina","Vera"}; LinkedList<string> list = new LinkedList<string>(students); foreach (var stu in list) { Console.WriteLine(stu); } // add a node at the end Console.WriteLine("Node added at the last..."); list.AddLast("Anne"); foreach (var stu in list) { Console.WriteLine(stu); } } }
Output
Jenifer Angelina Vera Node added at the last... Jenifer Angelina Vera Anne
- Related Articles
- LinkedList AddFirst method in C#
- LinkedList AddAfter method in C#
- LinkedList Remove method in C#
- LinkedList RemoveFirst() Method in C#
- LinkedList RemoveLast() Method in C#
- LinkedList Clear() Method in C#
- LinkedList Contains Method in C#
- LinkedList AddBefore method in C#
- What does the method addLast(E e) do in java?
- LinkedList in C#
- How to use addLast() in android LinkedBlockingDeque?
- Removing all nodes from LinkedList in C#
- Singly LinkedList Traversal using C#
- Copy the entire LinkedList to Array in C#
- C# Program to create a LinkedList

Advertisements