geeksforgeeks ide code example
Example 1: gfg ide
class A:
def hello1(self):
print("Super")
class B(A):
def hello1(self):
print("Child1")
class C(B):
def hello(self):
print("Child2")
ob = C()
ob.hello()
ob.hello1()
Example 2: gfg ide
lass LinkedList {
Node head;
static class Node {
int data;
Node next;
Node(int d)
{
data = d;
next = null;
}
}
public void printList()
{
Node n = head;
while (n != null) {
System.out.print(n.data + " ");
n = n.next;
}
}
public static void main(String[] args)
{
LinkedList llist = new LinkedList();
llist.head = new Node(1);
Node second = new Node(2);
Node third = new Node(3);
llist.head.next = second;
second.next = third;
llist.printList();
}
}