473,416 Members | 1,991 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

Is it safe to call a instance method from constructor?

dmjpro
2,476 2GB
Is it safe to call a instance method from constructor?
May 26 '10 #1
2 1791
Dheeraj Joshi
1,123 Expert 1GB
You can call an instance method. I think no harm.

Regards
Dheeraj Joshi
May 26 '10 #2
jkmyoung
2,057 Expert 2GB
As long as the method doesn't try to use any member that you haven't yet initalized it should be ok.
May 27 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: ‘5ÛHH575-UAZWKVVP-7H2H48V3 | last post by:
(see end of message for example code) When an instance has a dynamically assigned instance method, deepcopy throws a TypeError with the message "TypeError: instancemethod expected at least 2...
8
by: trying_to_learn | last post by:
Why do we need to explicitly call the copy constructor and the operator = , for base class and member objects in composition? ....book says "You must explicitly call the GameBoard copy-constructor...
9
by: keith | last post by:
I created a class libery which has name space Assembly and class Assembly and compiled it. Then created a C# project and called a method in the external class e.g. Assembly dll;...
4
by: MuZZy | last post by:
Hi, I'm retouching some utility classes used everywhere across our app, and there are certain methods used everywhere and pretty frequently. I'm changing them from instance methods to static...
6
by: miked | last post by:
If an instance method does not alter the containing class or any arguments of a referenced type is it thread safe? public void GetSomething() { return new Something(this.Name); } public string...
8
by: Jeff Brown | last post by:
I understand that a static constructor is not called until and unless the class is instantiated, or any of its static members are referenced. But suppose (for the sake of argument) a class is...
9
by: Steve Richter | last post by:
in a generic class, can I code the class so that I can call a static method of the generic class T? In the ConvertFrom method of the generic TypeConvert class I want to write, I have a call to...
5
by: pixiedustjt | last post by:
Hello, This is my first time to post on the forum, so I hope I'm doing this correctly. I am working on the dreading Java Inventory Program that seems to be legendary. I am currently on part 3...
0
by: Maric Michaud | last post by:
Le Friday 05 September 2008 17:29:39 mercado mercado, vous avez écrit : Note that "self" for somemethod is just a local variable of the calling function. You cannot retrieve those local...
6
by: Christopher | last post by:
Its been awhile and I am rusty. Can the constructor of my class call another method in the same class if that other method does not change any member data? I want to simply have a seperate...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.