Latest Tutorials| Questions and Answers|Ask Questions?|Site Map




Have Programming Question? Ask it here!
 
 
 


sassy
OOP questions
1 Answer(s)      5 years and 8 months ago
Posted in : Java Beginners



Advertisement
View Answers

November 26, 2008 at 11:27 PM


Hi friend,

a. How many members does class XClass have?
Answer : 6

b. How many private members does class XClass have?
Answer : 2

c. How many constructors does class XClass have?
Answer : 2

d. Write the definition of the member func so that u is set to 10 and w is set to 15.3
Answer :
public void func()
{
u = 10 ;
w = 15.3;

}

e. Write the definition of the member print that prints the contents of u and w.

Answer :

public void print()
{
u = 10 ;
w = 15.3;

System.out.println("u : " + u);

System.out.println("w: " + w);


}
f. Write the definition of the default constructor of the class XClass so that the instance variables are initialized to 0(zero).

Anwer :

public XClass()
{
u = 0 ;
w = 0;
}

For more information on Java visit to :

http://www.roseindia.net/java/

Thanks


Related Tutorials/Questions & Answers:
OOP questions - Java Beginners
OOP questions  Consider the following declarations: { private int u; private double w; public XClass() { } public XClass(int a, double b) { } public void func() { } public void print
OOP questions - Java Beginners
OOP questions  Consider the following declarations: { private int u; private double w; public XClass() { } public XClass(int a, double b) { } public void func() { } public void print
Advertisements
OOP JAVa - Java Interview Questions
OOP JAVa  Is java is 100% OOP.?Plz giv full explanation.  hi Sanjay,dis is Srinivas(MCA from Andhra University).....Java is not an 100 % OOPL,because of the availability of Primitive Data Types
OOP
OOP   OO Analysis & Design Classes represent domain elements. May permit reuse. Other classes necessary Patterns are standard ways to relate classes UML is most common visual modelling technique is-a vs has-a Java
oop concept
oop concept  why Object class is super class for all class? 1.to use the Object class methods in subclass directly or 2.the Object class is usefull at the time of object create of subclass what
OOP
oop
OOP - Java Beginners
OOP Design Pattern  What is the oops design patterns
php oop functions
php oop functions  Just a quick question... php oop functions. can i call the main class function from an instantiated object of the child class
Java with OOP assignment (Eclipse)
Java with OOP assignment (Eclipse)  How do i control the length of characters in an input? E.g.: Enter your name > Hi * Name too short
PHP OOP Concepts
PHP OOP Concepts Object Oriented Programming  is a paradigm which is nowadays the most popular way to develop any application and most of the modern day language is based on this paradigm. OOP or Object Oriented Programming PHP has
oop answers - Java Beginners
oop answers  Consider the following declarations: { private int u; private double w; public XClass() { } public XClass(int a, double b) { } public void func() { } public void print() { } } XClass
what is the difference between pop and oop
what is the difference between pop and oop  what is the difference between pop and oop
OOP - Java Beginners
OOP  i have problem with OOP hope u'll help me write a program that allows the user to enter student' names followed by their test scores and outputs the following information (assume that the maximum number of students
OOP with Java - Java Beginners
OOP with Java  I had a look at the solution for the answers, in the website already, but my lecturer wants us to do it in another method. Here goes...) { Question2 q = new Question2(); q.buildSeats(); q.printSeats
OOP using Java - Java Beginners
OOP using Java  Can you write a Java statement that creates the object mysteryClock of the Clock type, and initialize the instance variables hr,min,and sec of mysteryClock to 7, 18, and 39, respectively. thank you!!! 
OOP with Java 2 - Java Beginners
OOP with Java 2  Define a class called BogEntry that could be used to store an entry for a Web log. The class should have member variables to store the poster's username, text of entry, and the date of the entry using the Date
OOP Using JAVA - Java Beginners
OOP Using JAVA  OBJECT ORIENTED PROGRAMMING USING JAVA (hope guys u will help me please i need your help,thank you so much) Create a Java program for a class named Money that contains data members.This class is used
OOP Tutorial [first draft]
Java: OOP Tutorial [first draft] Table of contents Introduction...-Oriented Design (OOD) and Object-Oriented Programming (OOP) An important part.... These notes are about programming and Java language features necessary for OOP, and do
OOP with Java-Array - Java Beginners
OOP with Java-Array  Write a program to assign passengers seats in an airplane. Assume a small airplane with seat numberings as follows: 1 A B C D 2 A B C D 3 A B C D 4 A B C D 5 A B C D 6 A B C D 7
OOP with Java 3 - Java Beginners
OOP with Java 3  Write a Temperature class that has two instances variables: temperature value (a floating-point number) and a character for the scale, wither C for Celsius or F for Fahrenheit. the class should have four
registration form using oop concept
registration form using oop concept  I would like to write a program student registration form at kindergartens and display the information of students that register to the kindergarten. How to make the form and display
PHP OOP Namespace
Namespace in PHP: The term namespace is very much common in OOP based language, basically it is a collection of classes, objects and functions. Namespaces... should always declare on the top of the page. PHP OOP Namespace Example: <
Java with OOP assignment (Eclipse) - Java Beginners
Java with OOP assignment (Eclipse)  "THREE Ts GAME" *Description* A "tic-tac-toe" game is a two player's board game where the game board is made of 3 X 3 grids. The two players, one being assigned with 'O' and the other
OOP
OOP       OOPs stands for Object oriented  Programming. Previously we used to follow.../beginners/oop-in-java.shtml
servlet questions
servlet questions  pls send servlet interview questions to anvesh2406@gmail.com
Java - Java Interview Questions
Java  Questions on Java
Object-Oriented Programming
Java: Object-Oriented Programming Beyond OOP Here's an interesting article about going beyond OOP: The Next Move in Programming: A Conversation with Sun's Victoria Livschitz at java.sun.com/developer/technicalArticles/Interviews
beginners questions
beginners questions  I need all the possible Java beginners questions to prepare for an Interview
interview questions - Java Interview Questions
interview questions for Java  Hi Any one can u please post the interview point of questions.Warm Regards, Satish
java - JSP-Interview Questions
are primitives  1. (from wikipedia) Object-oriented programming (OOP.... These are all fairly fundamental questions, try purchasing any introduction to Java
java questions - Java Interview Questions
java questions  HI ALL , how are all of u?? Plz send me the paths of java core questions and answers pdfs or interview questions pdfs or ebooks :) please favor me best books of interviews questions for craking
java - Java Interview Questions
Helpful Java Interview questions   Need Helpful Java Interview questions
Methods - OOP
Java NotesMethods - OOP Static methods If your method doesn't use an object of the class it is defined in, but does some work only on it's parameters, then you can declare the method to be static. Except for some
OOP Summary
Java: OOP Summary Objects All objects are allocated on the heap. Objects consist of instance fields for the class of the object, plus instance fields for its superclasses. Every object is created
javascript questions on date
javascript questions on date  how to add some days to an existing date
Hi - Hibernate Interview Questions
Hi   please send me hibernate interview questions
interview - Java Interview Questions
interview  kindly guide me some interview questions of Java
JAVA QUESTIONS - Java Beginners
java questions asked in interview oracle  Hi all, Does anyone have a list of Java questions that is generally asked in Interview at Oracle
Hibernate - Hibernate Interview Questions
hibernate interview questions and answers  Hi, Can anyone give me the best reference of hibernate interview questions and answers?Thanks in advance
programming questions
programming questions  this is my assignment questions please help me... the programs in c# language Describe the following with respect to creating Web Forms in .Net environment: a. Web Form Life Cycle b. Creating a Web Form
Questions on Spring - Spring
Questions on Spring  1> what is Spring Framework ? why does it come into existence.? 2> what is dependency injection and Inversion of Control...;Aspect-Oriented Programming(AOP) complements Object-Oriented Programming (OOP
 

 

 

DMCA.com