Home Tutorialhelp Comment error in my program

 
 

Comment

satya
error in my program ,
June 21, 2009 at 7:24 PM

switch case program in java
shows illegal start of type in this program . please guide .
here the program -
public class p1
{
public void menu()
{
System.out.println("1.area of a rectangle");
System.out.println("2.Area of a square");
System.out.println("3.Area of a circle");
}
public void accept(int l,int b,int s);
double a;
switch(ch)
{
case 1: a=l*b;
System.out.println("area of the rectangle ");
case 2 : a=l*l;
System.out.println("area of the squre ");
case 3 : a=22/7*r*r;
System.out.println("area of the circle ");
default:
System.out.println("wrong choice");
}
}

View All Comments | View Tutorial
Advertisement
Related Tutorial and Articles
Java Beginners

details of my program - Java Beginners
details of my program  hi 1- allow the customer to order any thing... array but it could make the program much longer note: i want to use the method... stupid alittle bit but this is my home work  import java.util. 

Java Beginners

ERROR with my JAVA code - Java Beginners
ERROR with my JAVA code  The error came up in my main method... it wasnt there until i finished my actionListener coding so I dont know how to fix this....it is really stressing me out!! HELP!!! import java.awt.*; import 

Java Beginners

error message - Java Beginners
error message  sir, while i m trying to execute my first program(print my name)I get error message like" javac is not recognized as internal...;Hi friend, To compile and run a java program we need to install java 

Java Beginners

doubt in my program code - Java Beginners
doubt in my program code  i have developed a web browser with the help of standard widget toolkit(swt) and java. i creted some buttons such as GO,REFRESH,STOP.... on which the name is not apppeared as GO,STOP...but the name 

Java Beginners

Servlet error - Java Beginners
Servlet error  I installed Jdk and tomcat successfully and all the examples provided by the tomcat are running successfully...But i'm unable to run my own servlet program.. The error i'm facing is... exception 

Java Beginners

Error in a code. - Java Beginners
Error in a code.  This is the question I posted yesterday: "I'm trying to write a program that has a text field for input, two buttons... is pressed the program has to calculate the prime factors of the given number. I 

Java Beginners

error in program when trying to load image in java - Java Beginners
error in program when trying to load image in java  Hi, I'm trying to add an image to my GUI using java graphics. I have cleaned up all my compiler errors but my program still won't run. I keep getting this type of message and I 

Java Beginners

Compile error - Java Beginners
Compile error  I get this error when compiling my program: java:167... to be thrown tc.countLines(inFile); ^ 1 error This is an example of my code: import java.io.*; import java.util.*; import 

Java Beginners

java compilation error - Java Beginners
java compilation error  I need to know how to correct a compiler error for my program to run. The error I keep getting is unclosed string literal... and this is when my compiler error occurs. Let me know if you need any 

Java Beginners

java compilation error - Java Beginners
the java_home and path in your environmental variables in "My Computer...java compilation error  i have downloaded java software(version 6 update 12) from www.java.com. whenever i try to compile the program using javac 

Java Beginners

Java compilation error - Java Beginners
Java compilation error  Hello, i am getting an error while running simple core java program on command prompt.java is installed on my pc.... For example if java is installed at c:\Program Files\Java\jdk1.6.0_01 

Java Beginners

Some additions for my previous question - Java Beginners
an invalid option, then the program should give an appropriate error message. I...Some additions for my previous question  This is the question I posted several hours ago: "I'm trying to write a program that has a text field 

Java Beginners

java runtime error - Java Beginners
and set the following: JAVA_HOME=C:\Program Files\Java\jdk1.6.0; Path=C:\Program Files\Java\jdk1.6.0\bin; Thanks  Hello Friend, I am thankful...java runtime error  import java.io.*; class Test { public static 

Java Beginners

java compilation error - Java Beginners
the codes I still received this message. My program compiles with no errors but I just can't run it ProductInventoryVGUI Uncaught error fetching image...java compilation error  Hello, I sent a previous message regarding 

Java Beginners

java compilatior error - Java Beginners
java compilatior error  Hello, here is some additional information you requested. This is what the main part of my program looks like, everything...() BELOW IS WHERE MY COMPILER ERROR OCCURS AND GIVES THE MESSAGE UNCLOSED 

Java Beginners

to add on to my queries - Java Beginners
to add on to my queries   Dear Experts, Sorry but I am worried that I did not explain clearly so I am adding in the error message I get from... in that codes. Many thanks. An error occurred: java.sql.SQLException 

Java Beginners

Java compilation error - Java Beginners
Java compilation error  I place the following code in to my program but get a compile error of cannot resolve symbol on this code... in qshell - javac -classpath /home/java/build/ ServiceLevelReport1.java */ public 

Java Beginners

Java Program MY NAME
Java Program MY NAME   Write a class that displays your first name vertically down the screen where each letter uses up to 5 rows by 5 columns of a character input by you with a blank line between each letter. Note: each letter 

Java Beginners

Java Program Complication error - Java Beginners
Java Program Complication error  Hi there, I have this program I had to write called ThreeArrayLists.java, but I keep getting this error "use of unchecked or unsafe operations" This is the criteria for the program 

Java Beginners

My first Java Program
My first Java Program  I have been caught with a practical exam to do the following: Write a program that takes input from a user through the command line. The user must be prompt to enter a sentence (anything). The sentence 

Java Beginners

JDBC:Runtime error - Java Beginners
program. When i run my program using NetBeans6.1 it is working fine. When i try to run the program from command prompt it is giving error. The follwing is the code of my program. I kept all the details in properties file. when i try 

Java Beginners

java error - Java Beginners
java error  Hello sir, on compiling any program from command prompt.... But if I want to run that program the fetches me the following error. For example for file: Test.java C:\Program Files\Java\jdk1.6.0_17\bin>javac Test.java 

Java Beginners

java compilation error - Java Beginners
java compilation error  Hello madam/sir, i m a beginners in java. My problem is that i want to connect a login form to a frame containing 4 panels. how could i do it?Please help 

Java Beginners

JDBC:Runtime error - Java Beginners
JDBC:Runtime error  Dear sir/madam, thanks to respond for my request... should have to follow to execute the program successfully. once again i am posting my code: thank you, regards, Krishna. BillerValidationUpload.java 

Java Beginners

java run time error - Java Beginners
java run time error  when i compile my program it didnt show any error in my program.but i cant run my program, if i run my program means it will show error like as following Exception in thread "main 

Java Beginners

error in java progran at run time - Java Beginners
error in java progran at run time  Hello sir,,, i make a servlet program in java,,but i face some problem,,so please me.. Actually this type of error are come in my all servlet program My Servlet-- Error 

Java Beginners

error in java progran at run time - Java Beginners
error in java progran at run time  Hello sir,,, i make a servlet program in java,,but i face some problem,,so please me.. Actually this type of error are come in my all servlet program My Servlet-- Error 

Java Beginners

Java Error - Java Beginners
Java Error  E:\SUSHANT\Core Java\FileHandling\Error>javac... ch= reader.read(); ^ 1 error import java.io.*; //program 9 class demo1 { public static void main(String args 

Java Beginners

JAVA Error - Java Beginners
JAVA Error  i have made my own calculator GUI..and i want the text..."); btnBack.setForeground(red); it send me an error message that goes like this unknown... the correct method i shall use to change the color of the text of my button 

Java Beginners

java error - Java Beginners
be dereferenced If Programme saved in SortFileData also shows some error Please rectify the errors and provide the coding that run properly Write a Java program...java error  Thanks for providing me the answer for the question 

Java Beginners

what is the error - Java Beginners
: "+ data);}}this program will also show such type of error ? DATA HAS...();//System.out.println("Data : "+ data);}}if you want error free program the correct...what is the error  What is the compile time error that i am getting 

Java Beginners

Error - Java Beginners
: Enter the HexaDecimal : I got error in the line String status=session.getAttribute-----> Type of error... IOException{ System.out.println("This program convert string to Hexa 

Java Beginners

Compiling Error - Java Beginners
Compiling Error  cant able to compile java servlet file in the command prompt? WHY? but i can compile normal java file give me answer to fix my problem 

Java Beginners

Addition to my previous post - Java Beginners
Addition to my previous post  Addition to my previous question about the address book program. I need to have separate classes: CmdLineAddressBook.java AddressBook.java Contact.java Address.java Name.java 

Java Beginners

java run time error - Java Beginners
java run time error  i am getting error "main" java.lang.NullPointerException" in my program, iam sending code actually motive of program....... please correct my program, tell me where the problem occurs and what should 

Java Beginners

Error in POI - Java Beginners
Error in POI  Hi friend, I am working with Excel using POI API.I need to read an excel file and do some modifications and save this file... is not used by the program. For this I wrote a method inside calling 

Java Beginners

compilation error - Java Beginners
this program it is giving an error as integer number is too large.why? and what is the reason?  Hi Friend, In Java there are some specific literal... not in the Hexadecimal or Octal. Here is fraction of Java code example which will help you 

Java Beginners

error detection - Java Beginners
error detection   Hi Amardeep and all friends out there could you pls tell me whats wrong with my codes shown down on this page, i tried... me an error,of "(" or "[" expected. i tried to change everything i can 

Java Beginners

Error - Java Beginners
Error  Hai I am sending my two files.This is for conversion of String to hex. Please have a look on the code. In jsp page I got errors. Error No 1:Incompatible type found,java.lang.objectrequired,java.lang.string. Error 

Java Beginners

ERROR - Java Beginners
ERROR  Hello Sir i am getting error to this code 1.write a java program to read these strings apple orange banana and display the frist... am getting an error that is StringProgram.java:6: cannot resolve symbol 

Java Beginners

Compiling Error - Java Beginners
Compiling Error  cant able to compile java servlet file in the command prompt? WHY? but i can compile normal java file give me answer to fix my problem.  Hi Friend, Do you have servlet-api.jar in the lib folder 

Java Beginners

a java program - Java Beginners
about the second line... i have made my program but not able to click... for more information. http://www.roseindia.net/java/beginners/PrimeNumber.shtml... a java program  well sir, i just wanna ask you something regarding 

Java Beginners

HTTP 500 Internel server error in Custom tag program on Weblogic 8.1 - Java Beginners
HTTP 500 Internel server error in Custom tag program on Weblogic 8.1  Dear sir, Please attend my problem... I face the Error 500 Internel server error when I run the custom tag program on weblogic 8.1. My program Structure 

JSP Servlet Questions

error
error  i have 404 error in my program plz tell me yhe solution about 

JSP Servlet Questions

error
error  i have 404 error in my program plz tell me yhe solution about 

Java Beginners

compilation error - Java Beginners
compilation error  sir what is the error inthis code after...;i  Hi friend, Some points to be remember to run the Program : 1)Save the file "Group.java" in the c: drive . 2)For compile the program 

Java Beginners

: Java Compilation error. - Java Beginners
: Java Compilation error.  what is the difference between static... on java visit to : http://www.roseindia.net/java/beginners/ http://www.roseindia.net/java/beginners/howtoaccessstaticmethod.shtml Thanks   static 

Java Beginners

compilation error - Java Beginners
compilation error  i 'm not able to compile a program : prblem is there is one package in which 2 class person & dog reside. both classes r public... in same package Dog class is being compiled bt. Person is not compiled . error 

Java Beginners

Error handling - Java Beginners
Error handling  Hello, Help me write code as instructed bellow for a Java program. 1. Create a new Movie class which has two properties, title...://www.roseindia.net/java 

Java Beginners

readline Error - Java Beginners
readline Error  Hi sir, please helpme with my code. Mycode does not work. The readLine () method seems to loose the first character of the string...; Hi Friend, Your code works fine here. Thanks  The error 

Java Beginners

Servlet error - Java Beginners
Servlet error  Can't we place the java files instead of class files... to compile the java files separately and then place the class files in classes folder..??  Hi Friend, You can simply save your java file in classes 

Java Beginners

an error - Java Beginners
an error  Hi everyone ? pls i tried to run my following codes but i detect an error after trying to compile and run them,howevre i can't find out where i made a mistake,thus pls try to find it and help me where i have gone wrong 

Java Beginners

Error - Java Beginners
Error  I compiled 1 java program,it compiled fine,but can't execute... try to solve the error.but i dont know where to correct the error. i am new to java. here following i post the code import java.lang.*; import java.io. 

Java Beginners

Compile time error
Compile time error  Hi, When i compile my simple program in cmd am getting a error like "Javac is not a recognized as an internal or external... the following link: http://www.roseindia.net/java/beginners/installing_java.shtml 

Java Beginners

compilation error - Java Beginners
-Xlint:unchecked Anyways, it will make no harm and your program will get run 

Java Beginners

java compilation error - Java Beginners
writing my code through command line instead of a note pad but while compiling I'm getting the error like file not found : exxx.java(my file name is exx), Ill...java compilation error  Dear Sir ........ I was installed the java 

Java Beginners

Exception Handling-Error Messages in Program
Exception Handling-Error Messages in Program  Hi Friend, I am having trouble running this code as per my prior question on Exception handling... with this. Here is the code with the error messages as Follows: import 

Java Beginners

plz. answer my ques - Java Beginners
plz. answer my ques  I want to ask a prog. prob which would create a prog that would simply take username and password as input and will display... such type of program is possible in c.  can you mention technology 

Java Beginners

java compilation error - Java Beginners
java compilation error  Hello, I'm having problems with trying.... It's flagging two errors for this one code. The first error says identifier expected and the next error says invalid method declaration; return type required 

Java Beginners

Compilation error in java - Java Beginners
that file in java class,my code is Properties props = new Properties(); File...Compilation error in java  i have a properties file named... FileInputStream(f); props.load(in); but i got a error the system could 

Java Beginners

java compilation error - Java Beginners
java compilation error  i am going to type program and the error is shaded one this one is giving error please sole this one sir import java.io....:"+ch); } }   Hi friend, Having some error in your code check 

Java Beginners

java compilation error - Java Beginners
java compilation error  i am going to type program and the error is shaded one this one is giving error please sole this one sir import java.io....:"+ch); } }   Hi friend, Having some error in your code check 

Java Beginners

Java Compilation error - Java Beginners
Java Compilation error   i wrote a simple hello world program i get this error every time please help Exception in thread "main" java.lang.NullPointerException 

Java Beginners

error while compiling - Java Beginners
error while compiling  i am facing problem with compiling and running a simple java program, can any one help me, the error i am getting is javac is not recognised as internal or external command  Check if you JAVA_HOME 

Java Beginners

Java Program - Java Beginners
Java Program  My friend has a java project. He wanted to have java program that has 4 menu options which are (1)Add Data(from the user:last name, first name and age),(2)Sort Data,(3)Insert Data and (4)Delete Data, but he didn't 

Java Beginners

Java Program - Java Beginners
Java Program  Write a program to find the Factorial of a number using Recursion. Factorial can be defined as Factorial(n) = 1 * 2 * 3 ?.* (n-1...; 0){ System.out.println("Error"); } if ( num ==1) return 1; f 

Java Beginners

java compilation error - Java Beginners
); MY ERROR FLAGS HERE public class DisplayImage extends Panel { BufferedImage image; public DisplayImage() { try{ MY SECOND ERROR FLAGS HERE...java compilation error  Hello, I had recently sent an email 

Java Beginners

java compilation error - Java Beginners
of the user defined classes and the packages in a Java program for the Java Virtual Machine. Setting the class path is mandatory to run a java application. Please...java compilation error  how to set path and class path for java.. why 

Java Beginners

Java Compilation error - Java Beginners
Java Compilation error  import java.io.*; import java.util.... use file in my programe,.. my question is,when i want to call resultAcc... error there,.. [';' expected] the semicolon i already put at the end like 

Java Beginners

Java Compilation error - Java Beginners
Java Compilation error  import java.io.*; import java.util.... getInd() { return ind; } } i use file in my programe,.. my question is,when i want to call resultAcc() in main,how should i do 

Java Beginners

java runtime error - Java Beginners
java runtime error  sir, i have installed jdk in my system.i had also set path.But i am unable to run the compiled class file.it shows run time...://www.roseindia.net/java/java-classpath.shtml Thanks 

Java Beginners

Java Runtime error - Java Beginners
Java Runtime error  I have designed a simple chat application where... of my computer and then designed a GUI application to interact between the two. I get this error: java.net.ConnectException: Connection refused: connect 

Java Beginners

Java Compilation Error - Java Beginners
Java Compilation Error   Actually Iam having a packaging. Whatever methods and the imported packages are used in the program are available... imported packages. What ever error iam getting is at the array usage. So, guide me 

Java Beginners

Java Program - Java Beginners
Java Program  Hi, I'm have complications with this program. I keep getting errors and my coding is off. Can you help me? Write a program called...: Have your program accept the user input in two text fields. When a button 

Java Beginners

Java Compiler Error - Java Beginners
Java Compiler Error  I get this error when i compile this Java inheritance OOP. What I'm i doing wrong. F:\Java\WorkerDemo.java:9: cannot find..."); ^ 1 error Tool completed 

Java Beginners

Java compilation error - Java Beginners
Java compilation error  hai, now only i have started to work with java.I have been given a task as execute unix codes using eclipse.But i dont know the source codes.Please help me to start the program... Regards, R.Punitham 

Java Beginners

java program - Java Beginners
java program  Take in 7 numbers as command line arguments and store it in a collection. The numbers are to be displayed in the reverse order in which they were entered. Proper error messages should be displayed if: i) command 

Java Beginners

Java Compilation error - Java Beginners
Java Compilation error  how to put 2 classes on java program?and what shall i do if symbol not found appear?  Hi Friend, Try the following code: class Determine{ public int add(int a,int b){ return a+b 

Java Beginners

java compilation error - Java Beginners
java compilation error  here is the rest of my codes. I hope you...) { ProductInventory2.addProduct(temp); repaint(); MY COMPILER ERROR BEGINS BELOW... haven't provide the code of classes Product and Inventory2.Thatswhy 2 error occurs 

Java Beginners

Java program? - Java Beginners
Java program?  In order for an object to escape planet's.... The escape velocity varies from planet to planet.Create a Java program which calculates the escape velocity for the planet. Your program should first prompt 

Java Beginners

Java program - Java Beginners
not that familiar with java environment.. My friend told me that you can help me with my...Java program  Dear maam/Sir, I am a 2nd year Computer programming student and we are given an assignment, a program that will show 

Java Beginners

Java Program - Java Beginners
Java Program  Hi I'm having trouble with this problem, I keep getting errors. Write a program GuessGame.java that plays the game ?guess the number? as follows: Your program chooses the number to be guessed by selecting 

Java Beginners

Java Program - Java Beginners
Java Program  Create a program that will have the following: 1... / Oracle) 5. An interface (GUI) for data entry and display. The program will read a file of student names and save these on the database. The program should 

Java Beginners

Java Compilation Error - Java Beginners
Java Compilation Error  hi, i'm chandrakanth.i got a dought regarding below program. It generates compilation error.but it executes and generates... for more information. http://www.roseindia.net/java/master-java/index.shtml 

Java Beginners

scanner Class Error - Java Beginners
scanner Class Error  Hello Sir ,When i run the program of Scanner Class ,there is Error Can not Resolve Symbol-Scanner how i can solve this problem,   Hi Friend, If your Java is not version 1.5 or above 

Java Beginners

Java Complication Error - Java Beginners
Java Complication Error  Hello there, I was assigned to do a project in java that I have to set up tabs and in each tab have something in them. Well... this error: Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException 

Java Beginners

error
is"+sum); } } this is my program i need to print the series (1+2/12)+(1+2 

Java Beginners

error
"+it); } } this is my program i am getting an error saying cannot find symbol class string 

Java Beginners

java packge program - Java Beginners
java packge program  my question is how to compile and run java package program in the linux OS 

Java Beginners

i am unable to identify the error in my code
i am unable to identify the error in my code  class Program { public static void main(String[] args) { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); System.out.println("enter 

Java Beginners

i am unable to identify the error in my code
i am unable to identify the error in my code  class Program { public static void main(String[] args) { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); System.out.println("enter 

Java Beginners

java program for me to see who are on my server
java program for me to see who are on my server  Hello, Im a beginner in java, doing some tutorials and stuff. I wanna write a java program to put on my server where i wanna see if like 3 people are on my server PLUS that i want 

Java Beginners

XML DOM error - Java Beginners
); } } } the above program "To Count XML Element" was copied from this website (roseindia.net) but im getting a error like this... "java.io.IOException: Server returned HTTP... got the error again,then send full error details. Thanks 

Java Beginners

writig a program - Java Beginners
writig a program  Write an application that reads in a five digit integer and determines whether or not it is a palindrome. if the number is not five digits long, displays an error message indicating the problem to the user 

Java Beginners

Error While Compiling - Java Beginners
Error While Compiling  Hi All I Am a beginner and i face the following problem while compiling can anyone help me. C:\javatutorial\example>... command, operable program or batch file. C:\javatutorial\example>   

Java Beginners

program - Java Beginners
make some corrections about my mistakes...i have got half the pattern but full is not coming.. see my program... import java.io.*; class triangle...program  write a program to print the following pattern 

Java Beginners

I need add my java program with a picture.
I need add my java program with a picture.  Good evng Frnds Friends i created 1 jar file in my desktop. I need add this program with 1 picture. Whenever the user double clicking on that picture The program must start instead 

Java Beginners

j2ee deployment error - Java Beginners
j2ee deployment error  hi all Here is some problem which is often occured when i deployed a J2EE web application.When i deployed my application...-impl.xml:550: Deployment error: Cannot perform required operation, since 

Java Tips and Examples

Error processing
Java: Error processing Error in user input or action If the user makes... to correct their problem. I recently used a program that produced "Error in processing" as the error message. There was no hint as to whether is was my error 

Java Beginners

installation error
installation error  Error : Invalid path, "C:\Program Files\Java\jdk1.6.0\bin\javac.exe" -g -classpath "C:\Documents and Settings\Admin\My Documents" -d "C:\Documents and Settings\Admin\My Documents" "C:\Documents and Settings 

Advertisements Advertisements
 

 

 

DMCA.com