Results 1 to 3 of 3
Thread: trouble with a class
- 06-17-2009, 05:04 AM #1
Member
- Join Date
- Jul 2008
- Posts
- 4
- Rep Power
- 0
trouble with a class
Hi:
I have a problem with the following class:
import java.io.*;
public class CCadenas
{
//turn String into UpperCase chars
static void LowecaseUppercase(char[] str)
{
int i=0, desp = 'a'-'A';
for(i=0;1<str.length&&str[i]!='\0';i++)
if (str[i]>='a'&&str[i]<='z')
str[i]=(char)(str[i]-desp);
}
public static void main(String[]args)
{
char[]cadena=new char [80];//character String
int car, i=0; //a character and subindex for matrix
try
{
System.out.println("Type in a character string:")
while ((car=System.in.read())!='\r'&&i<cadena.length)
cadena[i++]=(char)car;
\\turn Lowercase into Uppercase
LowercaseUppercase(cadena);//calling method
System.out.println(cadena);
}
catch(IOException ignorada) {}
}
}
when I run it I get the following message:
C:\PRUEBAS>javac CCadenas
javac: invalid flag: CCadenas
Usage: javac <options> <source files>
where possible options include:
-g Generate all debugging info
-g:none Generate no debugging info
-g:{lines,vars,source} Generate only some debugging info
-nowarn Generate no warnings
-verbose Output messages about what the compiler is doing
-deprecation Output source locations where deprecated APIs are used
-classpath <path> Specify where to find user class files
-sourcepath <path> Specify where to find input source files
-bootclasspath <path> Override location of bootstrap class files
-extdirs <dirs> Override location of installed extensions
-d <directory> Specify where to place generated class files
-encoding <encoding> Specify character encoding used by source files
-source <release> Provide source compatibility with specified release
-target <release> Generate class files for specific VM version
-help Print a synopsis of standard options
It seems like an error in trying to find the class in my folder but my class is on the correct classpath and everything and my question is if you could give me an idea on what the problem might be considering this list of errors I get.
Thanks in advance!!
- 06-17-2009, 05:59 AM #2
When you compile a Java program you have to include the .java:
Once it compiles without errors, you can run as follows:javac CCadenas.java
Luck,java CCadenas
CJSLChris S.
Difficult? This is Mission Impossible, not Mission Difficult. Difficult should be easy.
- 06-17-2009, 10:01 PM #3
Member
- Join Date
- Jul 2008
- Posts
- 4
- Rep Power
- 0
Similar Threads
-
Here comes trouble... :-)
By sargehendricks in forum IntroductionsReplies: 1Last Post: 04-23-2009, 03:18 PM -
Having trouble understanding Class Graphic
By Bernard Robitaille in forum JCreatorReplies: 1Last Post: 04-18-2009, 02:55 AM -
Trouble with ImageIO
By sari in forum New To JavaReplies: 1Last Post: 03-30-2009, 09:42 PM -
hi there got alittle trouble
By justime8 in forum New To JavaReplies: 7Last Post: 12-24-2008, 12:22 AM -
having some trouble
By Unknown1369 in forum New To JavaReplies: 13Last Post: 07-21-2008, 11:52 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks