• 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

few simple q's on terminology

 
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

ok, just to make sure we're all speakin' the same language, i need to get
a few things straight.
1. the difference between a declaration and a definition.
is the following correct?

How about a method declaration vs. definition? (you can prolly
guess i come from a c++ background.)
2. an expression vs. a statement vs. a clause. in the following code:

what is the if clause?
the if statement?
the if expression?
I've seen these 3 words bandied about to describe various
pieces of code and i'd like to get it straightened out.
 
Ranch Hand
Posts: 4716
9
Scala Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In answer to question 1, in java we have abstract methods which is just method signature with no body. for example
abstract void doSomething(String s);
An abstract method is implemented(I think that is correct term) in the class that extends the abstract class, or implements the interface containing the abstract method. It is there that the code to actually do something is.
hope that helps
 
John M. Gabriele
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks randall,
it seems that, when it comes to methods, implementation
and definition seem to mean the same thing. whereas, a
method with no body (just the sig, like in an abstract
method in a superclass) might be called an abstract
method declaration. (?) at least, that seems to make sense.
anyone else?
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic