Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

static methods

 
anushree ari
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
under what circumstances static main method can call non static method,
expecting the reply soon,
thx in advance
 
david eberhardt
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by anushree ari:
under what circumstances static main method can call non static method,
expecting the reply soon,
thx in advance

the key concept is that non-static methods and variables belong to instances of a class;
dough -
a. A soft, thick mixture of dry ingredients, such as flour or meal, and liquid, such as water.
b.A pasty mass similar to this mixture
dough´┐Żnut -
A small ring-shaped cake made of rich, light dough that is fried in deep fat.

let's make a doughnut!


doughnut1.makeDoughnut(); allows us to call the non-static method named makeDoughnut() becasue we have an instance variable doughnut1 to attach to.
Did this help?
 
anushree ari
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thx david, it really helps a lot,
thank you very much
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic