Java experts.Please answer this question 1 Answer(s) 5 years ago
Posted in : Java Beginners
View Answers
May 16, 2008 at 6:30 PM
Hi
class A { int i, j; } class B { int i, j; } class C extends A { int k; } class D extends A { int k; } public class ins { public static void main(String args[]) { A a = new A(); B b = new B(); C c = new C(); D d = new D(); if(a instanceof A) System.out.println("a is instance of A"); if(b instanceof B) System.out.println("b is instance of B"); if(c instanceof C) System.out.println("c is instance of C"); if(c instanceof A) System.out.println("c can be cast to A"); if(a instanceof C) System.out.println("a can be cast to C"); System.out.println(); // compare types of derived types A object; object = d; // A reference to d System.out.println("object now refers to d"); if(object instanceof D) System.out.println("object is instance of D"); System.out.println(); object = c; // A reference to c System.out.println("object now refers to c"); if(object instanceof D) System.out.println("object can be cast to D"); else System.out.println("object cannot be cast to D"); if(object instanceof A) System.out.println("object can be cast to A"); System.out.println();
Java experts.Please answer this question - Java Beginners Javaexperts.Pleaseanswer this question class A
{
void get()
{
System.out.println("A's method");
}
}
class C extends A{}
class D extends...();
}
}
------------------------------------------
Read for more information.
http://www.roseindia.net/java
Clarify my last question's answer - Java Beginners
Clarify my last question's answer Dear expert,
I've tried out... did not specify my question too clearly.
Here's my 2 database... question. Do you want to search through id or through the qualification selected
Constructor Chaining Answer Java NotesConstructor Chaining Answer
Answers to the question in
Constructor Chaining.
Grandparent() constructor
Parent(25) constructor
Parent() constructor
Child() constructor
Copyleft 2003 Fred Swartz
MIT License,
Last
Question Answer
?
Browse Latest Questions
Question-Answer... HERE |ASK
QUESTIONS
Here, you can post your desired question. For
posting any question / query, please follow these steps:
Only post your
to know my answer
to know my answer hi,
this is pinki, i can't solve my question "how to change rupee to dollar,pound and viceversa using wrapper class in java." will u help me
share your answer to this question
share your answer to this question i need to know what is the TELERIK CONTROL?
what is the map suite?
what is dunda chart?
Also i have to know what are the websites available which give infor regarding this.
Let me know how
pls answer these question
pls answer these question Write a program that prompts the user to input the length and width of a rectangle.
Then calculate and prints the rectangleâ??s area and perimeter.
import java.io.*;
class rectangle
Please answer me - JSP-Servlet
Please answer me Hello Guys, this is the third time I'm sending this question. But I've not got the right answer from you. The again is: I need java servlet or jsp codes that I can use to insert and retrieve image from MSSQL
Question-Answer Guidelines Question-Answer Guidelines
How to ask questions... and rating the articles/ tutorials. Same like this, question-answer section...
Question-Answer Guidelines
Disclaimer
RoseIndia does
i cNT GET ANSWER FOR THIS QUESTION
i cNT GET ANSWER FOR THIS QUESTION The roots of the quadratic equation ax2+bx+c=0, aïâ??¹0 are given by the following formula:
x=(-bÃ?±âË?Å¡(b^2-4ac))/2a
In this formula. The term b2-4ac is called
send answer
send answer For online exam project,i want single question on single page and on that page there are three buttons previous,submit,next.If i click on next button it show next question from database
java.please answer this...
java.please answer this... Q1).How we can write a complete JAVA program that computes the following summation formulas..?
â??_(i=1)^nâ??ã??i^2=ã?? (n^(2 ) ã??(n+1)ã??^2)/4
Please , can any one answer this Question?
Please , can any one answer this Question? How to cummunicate one web application to another web application in different places
java question java question Implement a class called ShortAddress that has the following attributes: firstName, secondName, and phoneNumber.
Now implement... details or the long address details. This means your final answer should have
Urgent Answer Req
Urgent Answer Req how to view the file content which is at client side from jsp in java
question question sir plz tell me what should i give in title box. just i want java program for the question typed in this area
question question sir plz tell me what should i give in title box. just i want java program for the question typed in this area
Question Question When there is an exception in my program how java runtime system handles
Plz answer - Java Beginners
Plz answer Create a Java Bean Class â?? Customer according to the below given class diagram.
Customer
------------------------------------
- customerId : int
- customerName : String
- customerAddress : String
- pincode
question
question dear sir/madam
my question is how to compare two text format in java..we are java beginners..so we need the complete source code for above mentioned question...we have to compare each and every word
Core Java Interview Question, Interview Question
Core Java Interview Question Page 14
Question: What is clipping?
Answer: Clipping... that is implemented in a language other than Java.
Question: Can a for statement loop
Core Java Interview Question, Interview Question
Core Java Interview Question Page 17
 ....
Question: Can an object be garbage collected while it is still reachable?
Answer... : z ?
Answer: It is written x ? y : z.
Question: What is the difference between
Core Java Interview Question, Interview Question
Core Java Interview Question Page 21
 ... and are laid out using the squares of a grid.
Question: What an I/O filter?
Answer: An I....
Question: If an object is garbage collected, can it become reachable again?
Answer
java related question java related question How can we make a program in which we make mcqs question file and then make its corresponding answer sheet....like if we make 15 mcqs then java should generate it answer sheet of 15 mcqs with a,b,c d
Java Class Question? Java Class Question? 1.
Create an application names Numbers whose... but not display the answer instead it should return the answer to the calling method which displays the answer
Core Java Interview Question, Interview Question
Core Java Interview Question Page 22
Question: What is a compilation unit?
Answer: A compilation unit is a Java source code file.
Question: What interface
Core Java Interview Question, Interview Question
Core Java Interview Question Page 27
 ...
Question: Explain modifier final
Answer:
Final can be applied... and methods
Question: Can abstract class be instantiated
Answer
Core Java Interview Question, Interview Question
Core Java Interview Question Page 26
 .... Which primitive datatypes are signed.
Answer: All except char and Boolean
Question.... It range is 0 to
2^7-1
Question: What forms an integral literal can be
Answer
Core Java Interview Question, Interview Question
Core Java Interview Question Page 12
Question:
What is a transient variable?
Answer....
Question: How are Observer and Observable used?
Answer: Objects that subclass
Core Java Interview Question, Interview Question
Core Java Interview Question Page 16
 ...?
Answer: Frame
Question: How are commas used in the intialization... implementation is deferred to a subclass.
Question: How are Java source code files
Core Java Interview Question, Interview Question
Core Java Interview Question Page 15
 ... a container to be laid out and redisplayed?
Answer: validate()
Question:
What... is to provide access to the Java runtime system.
Question:
How many times may
Core Java Interview Question, Interview Question
mentions a shallow copy in Java?
Answer: Object cloning.
Question: If you're...
Core Java Interview Question Page 2
 ... a Vector and an ArrayList
Answer: Java Vector class is internally synchronized
Core Java Interview Question, Interview Question
Core Java Interview Question Page 23
 ... and interfaces that are loaded by a Java program.
Question: How does a try statement....
Question: What method must be implemented by all threads?
Answer: All tasks must
Core Java Interview Question, Interview Question
Core Java Interview Question Page 13
Question: What is an Iterator interface?
Answer...?
Answer: setBounds()
Question: How many bits are used to represent Unicode
Core Java Interview Question, Interview Question
Core Java Interview Question Page 30
 ...
Answer:
Yes constructors can be overloaded
Question: What happens when... in the constructor
Question: What is an inner class
Answer:
An inner class is same
Core Java Interview Question, Interview Question
Core Java Interview Question Page 19
 ... an exception be rethrown?
Answer: Yes, an exception can be rethrown.
Question: Which... is the immediate superclass of the Container class?
Answer: Component
Question
question
question how to capture web snippets using java or java script
Core Java Interview Question, Interview Question Question: What is the ultimate ancestor of all java classes
Answer:
Object class is the ancestor of all the java classes
Question: What...
Core Java Interview Question Page 32
 
Core Java Interview Question, Interview Question
Core Java Interview Question Page 20
Question: Name four Container classes.
Answer... by the Java run-time system?
Answer: The Java runtime system generates
Runtime
question
question why java is platform independent in nature
question
question how to solve the problem of The requested resource is not available+java+eclipse
question
question select from table using jsp , java bean and mysql
QUESTION
QUESTION please atach java tutorial to my email
Hello Friend,
Please visit the following link:
Java Tutorial
Thanks
question
question which language is leading the world java or .net
and which language followed by all the Oops principles either java or .net
Core Java Interview Question Page 3
.
Question: What is user-defined exception in java ?
Answer: User-defined...
Core Java Interview Question Page 3
 ...;
Answer: Yes, We can call a abstract method from a Non abstract method in a Java