This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
import java.util.Stack; | |
public class LeaderInArray { | |
public static void main(String[] args) { | |
Scanner sc=new Scanner(System.in); | |
int t=sc.nextInt(),n; | |
for(int tc=0;tc<t;tc++){ | |
n=sc.nextInt(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.mayanknc1; | |
public class Main { | |
public static void main(String[] args) { | |
//Runtime polymorphism can't be achieved by data members. It can be achieved by Methods only | |
A x = new A(); | |
x.print(); |