• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Compiler Error(Help)

 
Greenhorn
Posts: 18
1
Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So,i was just playing with some codes(Ques 8,chapter 3 of sybex book 1) and then suddenly compiler went mad at me :

C:\Users\Mr_Nobody\java>javac StringTest.java
StringTest2.java:3: error: incompatible types: java.lang.String cannot be converted to String
String numbers = "12345678";
^



I don't understand,should I call method from different class.?
 
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That error doesn't match the code you posted.
Also, have you created your own String class by accident?
 
Akash Trivedi
Greenhorn
Posts: 18
1
Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oops,my bad. I created the String class by mistake. Thanks for pointing out. ;)
 
reply
    Bookmark Topic Watch Topic
  • New Topic