Solved

also overloading methods!

Posted on 2002-04-17
3
165 Views
Last Modified: 2010-03-31
which one of the following is wrong and why
 
class student
{
public student(){}

public student (int a){}
public student (int b) {}
public student (in a,int b){}
public student (double a){}
public student (double a,double b){}

}

0
Comment
Question by:ms_lost
3 Comments
 
LVL 9

Accepted Solution

by:
Venci75 earned 20 total points
ID: 6947354
public student (int a){}
public student (int b) {}

you can't have 2 methods (constructors) with same names and same types of parameters
0
 

Expert Comment

by:reynoldg
ID: 6947461
Venci75 is Right
0
 

Author Comment

by:ms_lost
ID: 6948940
thanks alot
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This video teaches viewers about errors in exception handling.

863 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

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now