logo
What's New
What's New
  Popular
Popular
  Top Rated
Top Rated
  Search
Search


Search :  

How to Add Link |   Modify Link   |   Login |     Register  |  Getting Rated |  Link to Us |  Feedback Us


Sponsors
FlashAdvisor.com
Web Directory
phpld Hacks
Software Download
Your Site Link




Categories
    3DS MAX
    ASP
    C And C++
    ColdFusion
    Database
    Dreamweaver
    Flash
    HTML
    Java
    JavaScript
    Linux
    Maya
    MS Excel
    MS PowerPoint
    MS Word
    Paint Shop Pro
    Perl and CGI
    Photoshop
    PHP
    Premiere
    Python
    Visual Basic
    Web Hosting
    XML
 

 

Declaring classes, variables, and methods
  

Home  » Java » General Java  

Declaring classes, variables, and methods Now let's look at ways we can modify classes, methods, and variables. There are two kinds of modifiers -- access modifiers and non-access modifiers. The access modifiers allow us to restrict access or provide more access to our code. Declaring classes, variables, and methods page 2 of 5 Now let's look at ways we can modify classes, methods, and variables. There are two kinds of modifiers -- access modifiers and non-access modifiers. The access modifiers allow us to restrict access or provide more access to our code. Class modifiers The access modifiers available are public, private, and protected. However, a top-level class can have only public and default access levels. If no access modifier is specified, the class will have default access. Only classes within the same package can see a class with default access. When a class is declared as public, all the classes from other packages can access it. Let's see the effect of some non-access modifiers on classes. The final keyword (see Java keywords and identifiers for more on keywords) does not allow the class to be extended. An abstract class cannot be instantiated, but can be extended by subclasses:

Hits: 208
Rate:   5.0(out of 5)  
Vote : 1   
Submit Date  : 2006-03-20
Submit By  : whizlabs
View Tutorial Declaring classes, variables, and methods
 Add Review
 Report Error
Rating Graph

0.0%
0.0%
0.0%
0.0%
100.0%
 1  2  3  4  5 
Rate This :
More Tutorials by this user

Behavior of the garbage collector
 Behavior of the garbage collector
Java Arrays
 Java Arrays
Flow control statements
 Flow control statements
Package and class declarations
 Package and class declarations
Interfaces
 Interfaces
Finalization
 Finalization
Assertions
 Assertions
Constructors
 Constructors
Exception handling
 Exception handling
  
Home | Sitemap | Feedback | Advertise with us
Best viewed in 800x600 resolution with Internet Explorer.
Site Developed and Hosted by EthicSolutions

Flash Tutorials    TemplateAdvisor.com    WebMastersHome.com

    Reseller Hosting    Reseller Hosting Linux