-
cannot resolve symbol
alright. No matter what i do i keep getting these two errors. Could anyone
tell me why.
javac Animals.java
Animals.java:44: <identifier> expected
System.out.println (oneLine.colorOf);
^
Animals.java:44: cannot resolve symbol
symbol : class out
location: class java.lang.System
System.out.println (oneLine.colorOf);
^
2 errors
CODE
import java.io.*;
import java.util.*;
import java.lang.*;
public class Animals{
String oneLine;
public void main( String [] args){
//Reading in from user.
BufferedReader in = new BufferedReader( new
InputStreamReader( System.in ) );
int [] arrayx = new int [5];
try{
System.out.println("Please enter an animal: ");
oneLine = in.readLine();
for (int i = 0; i<5; i++){
//storing value of oneline in an array.
oneLine += arrayx[i];
} //close for loop
} //close try
catch(Exception e){
{ System.out.println (e); }
} //close exception
} //close for main
////////////////////////////////////
//extend animals "Dogs" with method "color of"
public class Dogs extends Animals{
public String colorOf(){
return ("White");
if (oneLine == "Browny"){
return ("Brown");
}
if (super.oneLine == "Blacky")
return ("Black");
}
//Method List organs.
public String listOrgans() {
return ("liver,two lungs, heart, two kidnys, ext." );
if (oneLine == "Browny"){
return ("liver,two lungs, heart, ONE kidnys, ext." );
}
}
}
////////////////////////////
//THIS IS WHERE I AM GETTING THE ERRORS.
public class Browny{
System.out.println (oneLine.colorOf);
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks