Results 1 to 6 of 6
  1. #1
    bugger is offline Senior Member
    Join Date
    Nov 2007
    Posts
    111
    Rep Power
    0

    Default Access modifiers

    Have has following access modifiers:

    public, private, protected

    What is the default access modifier. For example if I dont put any access modifier with a method, what will be its access modifier?

    Java Code:
    String getAddress(){
    return address;
    }

  2. #2
    ravian is offline Senior Member
    Join Date
    Nov 2007
    Posts
    115
    Rep Power
    0

    Default

    I believe default modifier is Public.

  3. #3
    hardwired's Avatar
    hardwired is offline Senior Member
    Join Date
    Jul 2007
    Posts
    1,576
    Rep Power
    9

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    hardwired found a best link.

    What my suggestion is, use access modifiers as much as possible in your applications. It's good practice, isn't it?

  5. #5
    ravian is offline Senior Member
    Join Date
    Nov 2007
    Posts
    115
    Rep Power
    0

    Default

    So default is not public. This is an information for me.
    Thanks guys.

  6. #6
    bugger is offline Senior Member
    Join Date
    Nov 2007
    Posts
    111
    Rep Power
    0

Similar Threads

  1. SQL Server and MS Access
    By Hima in forum JDBC
    Replies: 0
    Last Post: 04-08-2008, 02:59 PM
  2. Replies: 3
    Last Post: 11-18-2007, 07:41 PM
  3. Access with MS SQL
    By cachi in forum JDBC
    Replies: 1
    Last Post: 08-07-2007, 07:54 AM
  4. Replies: 1
    Last Post: 08-07-2007, 07:51 AM
  5. Access a variable
    By Eric in forum New To Java
    Replies: 2
    Last Post: 07-04-2007, 08:29 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •