Language: Java

import java.util.*;

class Main{
		int[] count = new int[26];

	public static void main(String[] args){
		for(int i=0;i<26;i++){
			count[i]=0;
		}
		Scanner sc=new Scanner(System.in);
		while(sc.hasNextLine()){
			String line=sc.nextLine();
			for(int i=0;i<line.length();i++){
				String str =line.substring(i,i+1);
				Main.counter(str);
			}
		}
		System.out.println("a : "+count[0]);
		System.out.println("b : "+count[1]);
		System.out.println("c : "+count[2]);
		System.out.println("d : "+count[3]);
		System.out.println("e : "+count[4]);
		System.out.println("f : "+count[5]);
		System.out.println("g : "+count[6]);
		System.out.println("h : "+count[7]);
		System.out.println("i : "+count[8]);
		System.out.println("j : "+count[9]);
		System.out.println("k : "+count[10]);
		System.out.println("l : "+count[11]);
		System.out.println("m : "+count[12]);
		System.out.println("n : "+count[13]);
		System.out.println("o : "+count[14]);
		System.out.println("p : "+count[15]);
		System.out.println("q : "+count[16]);
		System.out.println("r : "+count[17]);
		System.out.println("s : "+count[18]);
		System.out.println("t : "+count[19]);
		System.out.println("u : "+count[20]);
		System.out.println("v : "+count[21]);
		System.out.println("w : "+count[22]);
		System.out.println("x : "+count[23]);
		System.out.println("y : "+count[24]);
		System.out.println("z : "+count[25]);
	}
		
	public void counter(String s){
		if(s.equals("A") || s.equals("a")){
			count[0]+=1;
		}else if(s.equals("B") || s.equals("b")){
			count[1]+=1;
		}else if(s.equals("C") || s.equals("c")){
			count[2]+=1;
		}else if(s.equals("D") || s.equals("d")){
			count[3]+=1;
		}else if(s.equals("E") || s.equals("e")){
			count[4]+=1;
		}else if(s.equals("F") || s.equals("f")){
			count[5]+=1;
		}else if(s.equals("G") || s.equals("g")){
			count[6]+=1;
		}else if(s.equals("H") || s.equals("h")){
			count[7]+=1;
		}else if(s.equals("I") || s.equals("i")){
			count[8]+=1;
		}else if(s.equals("J") || s.equals("j")){
			count[9]+=1;
		}else if(s.equals("K") || s.equals("k")){
			count[10]+=1;
		}else if(s.equals("L") || s.equals("l")){
			count[11]+=1;
		}else if(s.equals("M") || s.equals("m")){
			count[12]+=1;
		}else if(s.equals("N") || s.equals("n")){
			count[13]+=1;
		}else if(s.equals("O") || s.equals("o")){
			count[14]+=1;
		}else if(s.equals("P") || s.equals("p")){
			count[15]+=1;
		}else if(s.equals("Q") || s.equals("q")){
			count[16]+=1;
		}else if(s.equals("R") || s.equals("r")){
			count[17]+=1;
		}else if(s.equals("S") || s.equals("s")){
			count[18]+=1;
		}else if(s.equals("T") || s.equals("t")){
			count[19]+=1;
		}else if(s.equals("U") || s.equals("u")){
			count[20]+=1;
		}else if(s.equals("V") || s.equals("v")){
			count[21]+=1;
		}else if(s.equals("W") || s.equals("w")){
			count[22]+=1;
		}else if(s.equals("X") || s.equals("x")){
			count[23]+=1;
		}else if(s.equals("Y") || s.equals("y")){
			count[24]+=1;
		}else if(s.equals("Z") || s.equals("z")){
			count[25]+=1;
		}
	}
}

Compiler output:
Main.java:8: error: non-static variable count cannot be referenced from a static context
			count[i]=0;
			^
Main.java:15: error: non-static method counter(String) cannot be referenced from a static context
				Main.counter(str);
				    ^
Main.java:18: error: non-static variable count cannot be referenced from a static context
		System.out.println("a : "+count[0]);
		                          ^
Main.java:19: error: non-static variable count cannot be referenced from a static context
		System.out.println("b : "+count[1]);
		                          ^
Main.java:20: error: non-static variable count cannot be referenced from a static context
		System.out.println("c : "+count[2]);
		                          ^
Main.java:21: error: non-static variable count cannot be referenced from a static context
		System.out.println("d : "+count[3]);
		                          ^
Main.java:22: error: non-static variable count cannot be referenced from a static context
		System.out.println("e : "+count[4]);
		                          ^
Main.java:23: error: non-static variable count cannot be referenced from a static context
		System.out.println("f : "+count[5]);
		                          ^
Main.java:24: error: non-static variable count cannot be referenced from a static context
		System.out.println("g : "+count[6]);
		                          ^
Main.java:25: error: non-static variable count cannot be referenced from a static context
		System.out.println("h : "+count[7]);
		                          ^
Main.java:26: error: non-static variable count cannot be referenced from a static context
		System.out.println("i : "+count[8]);
		                          ^
Main.java:27: error: non-static variable count cannot be referenced from a static context
		System.out.println("j : "+count[9]);
		                          ^
Main.java:28: error: non-static variable count cannot be referenced from a static context
		System.out.println("k : "+count[10]);
		                          ^
Main.java:29: error: non-static variable count cannot be referenced from a static context
		System.out.println("l : "+count[11]);
		                          ^
Main.java:30: error: non-static variable count cannot be referenced from a static context
		System.out.println("m : "+count[12]);
		                          ^
Main.java:31: error: non-static variable count cannot be referenced from a static context
		System.out.println("n : "+count[13]);
		                          ^
Main.java:32: error: non-static variable count cannot be referenced from a static context
		System.out.println("o : "+count[14]);
		                          ^
Main.java:33: error: non-static variable count cannot be referenced from a static context
		System.out.println("p : "+count[15]);
		                          ^
Main.java:34: error: non-static variable count cannot be referenced from a static context
		System.out.println("q : "+count[16]);
		                          ^
Main.java:35: error: non-static variable count cannot be referenced from a static context
		System.out.println("r : "+count[17]);
		                          ^
Main.java:36: error: non-static variable count cannot be referenced from a static context
		System.out.println("s : "+count[18]);
		                          ^
Main.java:37: error: non-static variable count cannot be referenced from a static context
		System.out.println("t : "+count[19]);
		                          ^
Main.java:38: error: non-static variable count cannot be referenced from a static context
		System.out.println("u : "+count[20]);
		                          ^
Main.java:39: error: non-static variable count cannot be referenced from a static context
		System.out.println("v : "+count[21]);
		                          ^
Main.java:40: error: non-static variable count cannot be referenced from a static context
		System.out.println("w : "+count[22]);
		                          ^
Main.java:41: error: non-static variable count cannot be referenced from a static context
		System.out.println("x : "+count[23]);
		                          ^
Main.java:42: error: non-static variable count cannot be referenced from a static context
		System.out.println("y : "+count[24]);
		                          ^
Main.java:43: error: non-static variable count cannot be referenced from a static context
		System.out.println("z : "+count[25]);
		                          ^
28 errors