• 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

Error trying to call a method

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So... I know this should work---however for the life of me I cant seem to access the class method to get my program working---keeps saying cannot find symbol " RogerHenthornChapter12.java:7: error: cannot find symbol
Chapter12Driver Encrypt = new Encrypt();"



Here is the file that I am trying to reference the encrypt variable from



any help would be most appreciated!

 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"new" is for instantiating objects, not for invoking methods. The class of which the method "Encrypt" is a member has a different name.

By the way, you should get into the habit of naming things like everyone in the Java world does - classes start with uppercase letters, methods and fields with lowercase letters. That way everyone will understand what's what in your code right away.
 
Roger Henthorn
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've updated my code--and now it works:





Sorry for the temporary brain fart in coding---its been a long weekend, and staring at code without taking breaks tends to make me glaze over the obvious.

went and made a White Russian---allowed me enough time to get a fresh set of eyes on the code. The Dude Abides........


Thanks!


 
Roger Henthorn
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Um.... unsure what the heck the urls are in my code that I pasted from my textpad?!?! They are most certainly not in my finished code...

only changes I made were:

Chapter12Driver Encrypt = new Chapter12Driver();

and the calling methods:

Encrypt.encrypt




 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Um.... unsure what the heck the urls are in my code that I pasted from my textpad?


That's a known bug in the forum software, don't worry about it. I fixed your post
 
Roger Henthorn
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Ulf!
 
Could you hold this kitten for a sec? I need to adjust this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic