User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Java section within the Software Development category of DaniWeb, a massive community of 401,946 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,356 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Java advertiser: Lunarpages Java Web Hosting
Views: 1569 | Replies: 3
Reply
Join Date: Oct 2006
Location: Canada
Posts: 15
Reputation: THK is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
THK's Avatar
THK THK is offline Offline
Newbie Poster

Help java constructor..!

  #1  
Oct 7th, 2006
You are given a class named Clock that has one int instance variable called hours . Write a constructor for the class Clock that takes one parameter, an int , and gives its value to hours .

help me some one
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jun 2004
Posts: 604
Reputation: freesoft_2000 is an unknown quantity at this point 
Rep Power: 6
Solved Threads: 6
freesoft_2000 freesoft_2000 is offline Offline
Practically a Master Poster

Re: java constructor..!

  #2  
Oct 7th, 2006
Hi everyone,

public class clock
{

public clock(int num)
{

}

}

Richard West
Microsoft uses "One World, One Web, One Program" as a slogan.
Doesn’t that sound like "Ein Volk, Ein Reich, Ein Führer" to you, too?
— Eric S. Raymond

Tell me what type of software do you like and what would you pay for it

http://www.daniweb.com/techtalkforums/thread19660.html
Reply With Quote  
Join Date: Oct 2006
Posts: 26
Reputation: Rayhan Muktader is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 2
Rayhan Muktader Rayhan Muktader is offline Offline
Light Poster

Re: java constructor..!

  #3  
Oct 7th, 2006
You need to give out more details. Do you wish learn how to write constructors in general or are having a particular problem with you Clock class?

Constructor for you Clock class would look something like the following code:

public Clock(int h)
{
this.hours = h;
}
Reply With Quote  
Join Date: Oct 2006
Location: Canada
Posts: 15
Reputation: THK is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
THK's Avatar
THK THK is offline Offline
Newbie Poster

Re: java constructor..!

  #4  
Oct 7th, 2006
thanks! it's been lot of help..
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Java Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Java Forum

All times are GMT -4. The time now is 5:21 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC