Total members 11663 |It is currently Fri Sep 22, 2017 10:42 pm Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





import java.util.*;

class DFA
{
static int n;
static Scanner sr = new Scanner(System.in);
static char lang[];

public void getdata()
{
System.out.println("Enter the no of symbol: ");
n=sr.nextInt();
lang=new char[n];

System.out.println("Enter the language: ");
for(int i=0;i<n;i++)
{
lang[i]=sr.nextChar();
}
}

public void showdata()
{
System.out.println("Showing the lang you selected: \n");
for(int i=0;i<n;i++)
{
System.out.println(i+ " - " + lang[i]);
}
}
}
class main_DFA
{
public static void main(String args[])
{
DFA d=new DFA();
d.getdata();
d.showdata();
}
}

output:

E:\SEM6>javac main_DFA.java
main_DFA.java:18: error: cannot find symbol
lang[i]=sr.nextChar();
^
symbol: method nextChar()
location: variable sr of type Scanner
1 error




Author:
Newbie
User avatar Posts: 1
Have thanks: 0 time
Post new topic Reply to topic  [ 1 post ] 

  Related Posts  to : i got cannot find symbol error while compiling my program
 cannot find symbol constructor     -  
 compiling and getting of a java program     -  
 find a string     -  
 Find MAC Address     -  
 Find entity by id     -  
 find the difference between dates in asp.net     -  
 how to find size without using sizeof     -  
 Not to find nativeEncoder class jar     -  
 Hows does Windows find Java?     -  
 Unable to find javax.servlet     -  










Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team