GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  J2EE  >  Java
Go To First  |  Previous Question  |  Next Question 
 Java  |  Question 885 of 933    Print  
class A { void add(); }
class B { void add();}

class Ex {

public static void main(string args[]) {

A a=new B();
B b=new A();
a.add();
b.add();
}

What is the result;

  
Total Answers and Comments: 1 Last Update: August 14, 2007     Asked by: balu 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
August 14, 2007 08:15:49   
agsuvidha Member Since: June 2007   Contribution: 9    

RE: class A { void add(); } class B { void add(...
There is an error in this program.
as if u see clearly class A is an abstract class and abstract class can not be instantiated.



 
Is this answer useful? Yes | No

 Related Questions

Objects that subclass the Observable class maintain a list of observers. When anObservable object is updated it invokes the update() method of each of its observers tonotify the observers that it has changed 
Latest Answer : Observer observe only those class which are Observable. ...

Yes, a lock can be acquired on a class. This lock is acquired on the class's Class object.. 
Latest Answer : As your might already know, any synchronisation needs an object (monitor) to acquire lock one. See below for the three different types on how to synchronise code.public class A{  // A monitor object of sycnhronising piece of code.   private ...

It uses those low order bytes of the result that can fit into the size of the type allowed bythe operation. 
Latest Answer : Difference  Between   Over  Flow  &  Under  Flow   (JAVA)   over  flow  = ex : array>  [0][1][2][3][4]   only  present  5  bracket   but   ...

The Vector class provides the capability to implement a growable array of objects 
Latest Answer : A vector implements dynamic array, which can grow and shrink dynamically.It is similar to Arraylist with a difference that vector can be synchronized. it also contain some legacy methods. ...

A (non-local) inner class may be declared as public, protected, private, static, final, orabstract. 
Latest Answer : public can be used as it is the only access modifier which can access any class or methods from any class or package. ...

setBounds() 
Latest Answer : component.setBounds(-,-,-,-); ...

The EventObject class and the EventListener interface support event processing. 
Latest Answer : Java.util.Event class ...

Panel 
Latest Answer : The Immediate super class of Applet is PANEL ...

Window 
Latest Answer : System.Windows.Forms.CommonDialog ...

The default value of an String type is null. 
Latest Answer : variable of String type is automatically initialized to null value. ...


 Sponsored Links

 
Related Articles

Service Oriented Java Business Integration Review

Service Oriented Java Business Integration Review Introduction If you ve read through the texts which give you an introduction to SOA or Web Services you will often find them to be quite frustrating and the reason for this is because they spend too much time referencing business processes which are
 

C++ Void Pointer and Null Pointer

C Void Pointer and Null Pointer In this C tutorial you will learn about two interesting types of pointers; void pointers and Null Pointer These pointers will be discussed in conjunction with syntax usage and example mosgoogle center Pointer to Void General Syntax void pointer variable; Void is use
 

C++ Static Functions

C Static Functions Static member functions have a class scope and they do not have access to the this pointer of the class When a member is declared as static a static member of class it has only one data for the entire class even though there are many objects created for the class The main usage of
 

C++ Pure Virtual Function and Base Class

C Pure Virtual Function and Virtual Base Class In this C tutorial you will learn about pure virtual function declaration of pure virtual function and virtual base class virtual base class and how to implement a virtual base class explained with examples mosgoogle center What is Pure Virtual Function
 

C++ String Representation and Handling

C String Representation and Handling In this C tutorial you will learn about string representation and handling how is string represented end string notation initializing char array character representation string literals example programe to understand the character array concept and the accessing
 

Java and Client Server Models

Java and Client Server Models The Role of Client Servers on the Web Client server models provide the essential mechanisms for working with the Internet In fact most of the World Wide Web is built according to this paradigm In client server models the web browsers run by millions of users are the cli
 

How to Access C++ Class Members

How to Access C Class Members In this C tutorial you will learn how to access Class members dot operator or class member access operator difference between struct and class and  scope resolution operator mosgoogle center It is possible to access the class members after a class is defined an
 

JavaScript String Object

JavaScript String Object In this JavaScript tutorial you will learn about String Object purpose of string object in JavaScript purpose of string object indexof method lastIndexOf method and substring method along with syntax and example mosgoogle center Purpose of String Object in JavaScript The mai
 

Convert a String into an Integer

How to convert a string into an integer in C program? This is done by using the function named as atoi(). This function atoi() is present in the header file named as <stdlib.h>. When programmers use this function they must include the header file by the statement #include <stdl
 

String handling functions

What is the string handling functions present in header file <string.h>? There are number of string handling functions present in string.h. In other words if a programmer uses any of the function present in string.h then they must include the header file as #include <string.h&am
 

About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2010 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape