Total members 11890 |It is currently Fri Apr 19, 2024 10:51 am 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     -  
 how to find size without using sizeof     -  
 Not to find nativeEncoder class jar     -  
 find the difference between dates in asp.net     -  
 Find occurrences of each character in a string     -  
 Hows does Windows find Java?     -  









Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com