| | |
having problem with this Question
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Nov 2004
Posts: 1
Reputation:
Solved Threads: 0
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.
{
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.
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
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
![]() |
Similar Threads
- After finishing the 1st part, I still have many problem of this question. (Pascal and Delphi)
- simple cash register (pos) problem - please help!! (VB.NET)
- Traveling Salesman Problem ... question about Triangle Inequality (Computer Science)
- Algorithms Question (Bisection Method & Sqrt) (Computer Science)
- ASM Game Coding Problem/Question (Assembly)
- array question (C++)
- Spyware Problem and question involving BPS (Viruses, Spyware and other Nasties)
Other Threads in the Java Forum
- Previous Thread: shallow copying
- Next Thread: Problem in finding out an array
Views: 1911 | Replies: 4
| Thread Tools | Search this Thread |
Tag cloud for Java
6 android api apple applet application arc arguments array arrays automation binary bluetooth bold c++ chat class classes client code compare component coordinates database datagram doctype draw eclipse educational error event exception file fractal froglogic game givemetehcodez graphics gui guitesting helpwithhomework html ide ideas image ingres input integer internet intersect ip j2me java javaexcel javaprojects jmf jni jpanel jtextarea julia linux list loop map method methods mobile netbeans newbie nextline number object oracle print problem program programming project recursion recursive scanner screen sell server set size sms socket sort sql string swing test threads time transfer tree user websites windows





