Like This Site? 
 
RSS Feed Follow Us 

on Twitter! Be Our Fan!

Java - Declarations and Access Control : Complete Tutorial

Share this post!
 Vote this!

In Java the unit of programming is the class from which objects are eventually instantiated. An Object encapsulates data (attributes) and methods (behaviors), the implementation details are hidden within the objects themselves. See Java Object-Oriented for more information on OOP.
When you are writing Java code you are writing classes, within classes are variables and methods from which objects are eventually instantiated. How you declare a class affects your code's behavior.
Class rules
  • There can only be one public class per source code file
  • The name of the public class must match the name of the file
  • If the class is part of a package this must be the first line of code
  • Import declarations must be between package details and the class declaration
  • Import and package statements apply to all classes within the source code file  more...

0 comments:

Post a Comment