Solved

is this constructor public, why or why not

Posted on 2006-06-22
3
186 Views
Last Modified: 2010-03-31
Hi,

If I write a class like this:

Class A
{
   A()
{}
}

Is A's constructor public?
0
Comment
Question by:ly_uwo
3 Comments
 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 50 total points
ID: 16960635
No. It has default access
0
 
LVL 14

Accepted Solution

by:
hoomanv earned 75 total points
ID: 16960803
if you left an access level unspecified for a variable or method, it cant be accessed from classes and subclasses declared outside its package, but its accessible within the package, as CEHJ refered to as default access
0
 

Author Comment

by:ly_uwo
ID: 16961043
thanks
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question