Chidimma Juliana

Greenhorn
+ Follow
since Jul 14, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Chidimma Juliana

Hello Rio,

Congratulations!!!

How did you make it? I am also working towards writing the exam end of this month.

Chidimma.
Hello,

Am using command prompt and compiler is jdk, below is the version of the compiler;

C:\Documents and Settings\Chidimma\Desktop\Allfiles>javac -version
javac 1.6.0_26
I have corrected List to list which was used to invoke the iterator method. But the compilation still fails.



Hello Stephan,

Am sorry providing incomplete information.



Below is compiler error message.

C:\Documents and Settings\Chidimma\Desktop\Allfiles>javac TestLegacy.java
TestLegacy.java:5: non-static method iterator() cannot be referenced from a stat
ic context
Iterator it = List.iterator();
^
TestLegacy.java:8: cannot find symbol
symbol : method intValue()
location: class Integer
int i = ((Integer)it.next()).intValue();
^
TestLegacy.java:19: cannot find symbol
symbol : method add(int)
location: interface java.util.List<Integer>
myList.add(4);
^
TestLegacy.java:20: cannot find symbol
symbol : method add(int)
location: interface java.util.List<Integer>
myList.add(6);
^
.\Integer.java:9: cannot find symbol
symbol : constructor Integer()
location: class Integer
Integer y = new Integer();
^
.\Integer.java:11: cannot find symbol
symbol : method intValue()
location: class Integer
int x = y.intValue();




Thank you
Please could someone help ,

I tried to compile the program below but it fails;



What could be the problem?

Thank you
What the statement means is that two different objects can have equal hashcodes. However, if the objects are equal, then the hashcodes must also be equal.
Hello,

Please, could someone explain to me how to resolve this regex problem on Self test of Chapter 6 No1 of K & B. The book explaination is not clear to me.



And the command line:

java Regex2 "\d*" ab34ef

The answer on the book is 01234456.

Thank you.

Chidimma.
Hello Ogeh,

The Classpath worked for my Vista OS. I am excited about this, thank you so much. You have been helpful.
Hello Ogeh,

Am sorry I forget to mention that my OS is window vista.
Hello Ogeh,

Thank you for your assistance with the classpath, It was successful. Subsequently, I will use code button to paste my programs.
But, how can I permanently set my classpath to avoid doing it manually. I have tried to set it but not working out.
Hello Ogeh,

Thank you so much, the program compiled.

On execution side, was not able to execute. Below is the error ;

C:\Documents and Settings\Chidimma\Desktop\book>java -cp . Goo
Exception in thread "main" java.lang.NoClassDefFoundError: Goo (wrong name: book
/Goo)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:14
1)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: Goo. Program will exit.
Hello Ogeh,

I have now created two folders for package book named "book" and another for package cert named "cert" but still unable to compile the program.
Here are the errors.

C:\Users\Chidimma>cd C:\Documents and Settings\Chidimma\Desktop\book

C:\Documents and Settings\Chidimma\Desktop\book>javac -classpath C:\def Goo.java

Goo.java:4: package cert does not exist
import cert.*;
^
Goo.java:7: cannot find symbol
symbol : class Sludge
location: class book.Goo
Sludge o = new Sludge();
^
Goo.java:7: cannot find symbol
symbol : class Sludge
location: class book.Goo
Sludge o = new Sludge();
^
3 errors

when I tried to compile using this path - C:\Documents and Settings\Chidimma\\Desktop\book>javac -sourcepath C:\def Goo.java

The error became,
The filename, directory name or volume syntax is incorrect.

Hello Ogeh,

Both source files are in one directory. Below are error messages from compiler.

C:\Users\Chidimma>cd C:\Documents and Settings\Chidimma\Desktop\Allfiles

C:\Documents and Settings\Chidimma\Desktop\Allfiles>javac Goo.java
Goo.java:4: package cert does not exist
import cert.*;
^
Goo.java:7: cannot find symbol
symbol : class Sludge
location: class book.Goo
Sludge o = new Sludge();
^
Goo.java:7: cannot find symbol
symbol : class Sludge
location: class book.Goo
Sludge o = new Sludge();
^
3 errors

C:\Documents and Settings\Chidimma\Desktop\Allfiles>javac Goo.java
Hello,

Please, could someone explain how to compile and run these programs in two different source files.
Below is the error from command prompt when I tried to compile it.




C:\Users\Chidimma>cd C:\Documents and Settings\Chidimma\Desktop\Allfiles

C:\Documents and Settings\Chidimma\Desktop\Allfiles>javac Goo.java
Goo.java:4: package cert does not exist
import cert.*;
^
Goo.java:7: cannot find symbol
symbol : class Sludge
location: class book.Goo
Sludge o = new Sludge();
^
Goo.java:7: cannot find symbol
symbol : class Sludge
location: class book.Goo
Sludge o = new Sludge();
^
3 errors

C:\Documents and Settings\Chidimma\Desktop\Allfiles>javac Goo.java
Hello Ogeh,

Am actually new to java. Please, could give explain to me in details on how to use Code Buttons to edit my java programs.

Thank you.