having problem with this Question

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Nov 2004
Posts: 1
Reputation: hayesmark is an unknown quantity at this point 
Solved Threads: 0
hayesmark hayesmark is offline Offline
Newbie Poster

having problem with this Question

 
0
  #1
Nov 23rd, 2004
public class XClass
{
private int u;
private double w;
Public XClass () { }
Public XClass ( int a, double b)
Public void func() { }
public void print() { }
}
XClass x = new XClass (10, 20.75);


Q1. How many members does class XClass have?

Q2. How many private members does class XClass have?

Q3. How many constructors does class XClass have?

Q4. write the definition of the member func so that u is set to 10 and w is set to 15.3?

Q5. write the definition of member print that prints the contents of u and w?

Q6. write the definition of the default constructor of class XClass so that the instance variables are initialised?

Q7. write the definition of the Xclass constructor that takes two parameters so that u is initalised to a and w is initalised to b?

Q8. write a java statement that prints the values of the instance variable of x?

Q9. write a java statement that creates the XClass object t and initalises the instance variables of 1 to 20 and 35.0 respectively.
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 84
Reputation: jerbo is an unknown quantity at this point 
Solved Threads: 1
jerbo jerbo is offline Offline
Junior Poster in Training

Re: having problem with this Question

 
0
  #2
Nov 23rd, 2004
Which question? I see 9 questions.
Answer the ones you know, and we MAY be able to help with the rest.

However, this forum is not for you to submit your homework assignments for us to do.

You should at the very least try to answer them yourself first.
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 4
Reputation: oceanboy is an unknown quantity at this point 
Solved Threads: 0
oceanboy oceanboy is offline Offline
Newbie Poster

Re: having problem with this Question

 
0
  #3
Nov 23rd, 2004
Nice advise jerbo
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 3
Reputation: kendallniall is an unknown quantity at this point 
Solved Threads: 0
kendallniall kendallniall is offline Offline
Newbie Poster

Re: having problem with this Question

 
0
  #4
Nov 24th, 2004
The reality is i do not understand this question as i am very new to java, it is not homework it is online tests which i am doing any help will be very grateful
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 89
Reputation: MrScruff is an unknown quantity at this point 
Solved Threads: 0
MrScruff's Avatar
MrScruff MrScruff is offline Offline
Junior Poster in Training

Re: having problem with this Question

 
0
  #5
Nov 24th, 2004
Q1. Try looking up java members in google or structure the question differently like "whats a member in java?" then apply that answer to your question youve got. I mean i don't even know what it means by members.

Q2. How many private members does class XClass have?
Have a guess and say why you think and we will tell you if your right.

Q3. How many constructors does class XClass have?
Look up Java Constructors in a book or on the web, then check back at your code and see if you recognise anything.

Q4. write the definition of the member func so that u is set to 10 and w is set to 15.3?

Maybe you should go through a basic java tutorial if you are new to it It will give you somewhere to start. When youve done that come back see what you suggest for the answers and we can give you hints e.t.c

Try these:
http://java.sun.com/docs/books/tutor...ava/index.html
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 1911 | Replies: 4
Thread Tools Search this Thread



Tag cloud for Java
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC