Solved

also overloading methods!

Posted on 2002-04-17
3
167 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SHA2 certs for IIS AND Java? 2 113
hibernate jars 4 45
runtime exception 2 42
jsp error 6 27
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

820 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