Java single inhertiance and multiple inheritance

1.what is meant by inheritance,single inhertiance,multiple inheritance?2.define abstract class & abstract method?3.how to developed and delopying a SERVELT,JSP program in the TOMCAT APACHE SERVER,WEBLOGIC SERVER?PLZ send the answer for the particular abo

Showing Answers 1 - 40 of 40 Answers

meenakshi

  • Oct 20th, 2005
 

good service and i was in need of this kind of information

  Was this answer useful?  Yes

bambam chiudhary

  • Oct 20th, 2005
 

how to developed and delopying a SERVELT,JSP program in the TOMCAT APACHE SERVER,WEBLOGIC SERVER?
PLZ send the answer for the particular above question in step by Step process plz

  Was this answer useful?  Yes

sudhir Gupta

  • Oct 24th, 2005
 

Inheritence:Making a new class,this new class have some own characterstics and definatelly uesed some existing features so inheritence means using someting existing,reusability of code.means that one is super class and other is subclass,subclass used all the public features of super class.

sudhir 

  

  Was this answer useful?  Yes

Prabakar.Bolla

  • Nov 6th, 2005
 

hi ,

Question: 1.what is meant by inheritance,single inhertiance,multiple inheritance?
2.define abstract class & abstract method?
3.how to developed and delopying a SERVELT,JSP program in the TOMCAT APACHE SERVER,WEBLOGIC SERVER?
PLZ send the answer for the particular above question in step by Step process plz
4.what is meant by GET and POST service method?not difference i want defination
5.difference between servelt and applet?
6.PLZ tell About OOPS?
7.What is Connection Pooping?
8.what is meant by pass by value,pass by reference and their difference?
9. What is deployment descriptors?
10. What is phantom memory ?
11.Can I create final executable from Java?
12.How many ways do we have to load a class?

  Was this answer useful?  Yes

kranti

  • Nov 10th, 2005
 

* by using Class.forName() and ClassLoader.loadClass() we can load java.lang.class* By comparison, ClassLoader.loadClass() is an instance method and requires you to select a particular classloader, which may or may not be the loader that loads that calling code.*For example, if you are about to load a class you know has a very costly static initializer, you may choose to go ahead and load it to ensure it is found in the classpath but delay its initialization until the first time you need to make use of a field or method from this particular class.

  Was this answer useful?  Yes

ashok.r

  • Nov 14th, 2005
 

1.Inheritance is oops feature by which we can use the methods and functions of base class

2.Single Inheritance the type of inheritance where there is only one deriived class for base class

example:

public class derived imlements baseclass

3.multiple inheritance is the type of inheritance where there is one derived class for two base class.it is done using the help of interface and abstract class

example:

public class derived extends abstract implements inter

3.Abstract Class

abstact class are class which are used in inheritance.The abstract class have the keyword abstract.in abstract class we can declare the method using the keyword

abstract functionname();

4.Get

this method is used in servlets where the information fed by user is transmitted as query string

Post:

 this method is used in servlets where the information fed by user is transmitted after encryption.

bhagya

  • Nov 22nd, 2005
 

Inheritance is oops feature by which we can use the methods and functions of base class2.Single Inheritance the type of inheritance where there is only one deriived class for base classexample:public class derived imlements baseclass3.multiple inheritance is the type of inheritance where there.abstract class is just like aclass,but abstract class may contain abstact method or concrete method or both.we doesn't create object for this abstract class.abstract method is a method which doesn't have the implementation part,which implements in derived class.

G.DurgaPrasad

  • Dec 5th, 2005
 

It is quite helpful for freshers, if faqs like this get answers

  Was this answer useful?  Yes

inheritance is nothing but creating a new class from existing class

the new class is called sub class and existing class is called super class

new class(subclass) has methods,fields of super class and also has his own properties

geeta

  • Mar 1st, 2006
 

To my knowledge:Abstract method the one which doesn/t have the body. Abstract class is the class with atleast one abstract method(not mandatory),the other methods in it can have implementation.

  Was this answer useful?  Yes

Praveen

  • Mar 8th, 2006
 

Hi all,

-Inheritance is the means to achieve parent class characteristics to the child.

-Single Inheritance is a type of inheritance in which there is only one super class and one child class.

-Multiple Inheritance is one which has multiple base or parent classes.

-Abstract Methods are ones without body and are used for forcing the client to either provide implementation or to declare them as abstract.

-Abstract class is the collection of all abstract methods or non-abstract methods or a collection of both.These are used to provide a skeleton structure like a framework.Eg., HashMap class extends AbstractMap which contains some default methods and HashMap just gets access to them by extending AbstractMap.

-GET is a single step process in which all the data is sent through URL whilst POSt is a two step process in which first we imform the server to listen and then send all data.This is the reason why we have restriction on the limit of data being sent.

Deployment descriptors are text-based XML files whose elements describe how to deploy and assemble components into a specific environment. They also contain information about the components that can specify settings not contained in the code of the components themselves, such as initialization parameters and security settings.Deployment descriptors relate installation and configuration information about applications to the application servers. They can also be used to convey information about the application to other people involved in the development process.

  Was this answer useful?  Yes

Abstract class--> If you want to present a concept without being able to create an instance then abstract class is written. This calss is then subclassed to represent subcategories. e.g. Say Food is an abstract class then you can subclass it into categories like Fruits, Vegetables, Grains etc.Abstract method-->Abstract method means a method without implementation. Abstract class can contain abstract methods. If you want subclasses to have diffrent implementation for the same function(job) then you can write that method as abstract and subclasses must implement it. The classic example is draw() method. e.g.abstract class Graphics{int x,y;abstract void draw();}Now the subclasses of Graphics must implement draw() method. say Circle, Rectangle are the subclasses. they will have their own implementation for draw(). So the draw()method in Circle calss will draw a "Circle" and the one in the Rectangle class will draw a "Rectangle ".

swetha

  • Mar 27th, 2006
 

It'll be of great help .

  Was this answer useful?  Yes

Karthik

  • Apr 5th, 2006
 

1. Inheritance means , creating a new class from a existing class is known as inheritance. for ex

 public class a {

}

class b extends class a {

}

This is the example of single inheritance also.

3.After creating a servet or jsp file you need to follow the follwoing steps to delopying it..

4. Get is the method used in servlet, get method is not secure and it can only send 255 character.

But in post method you can send huge amount of data , and it is secured.

6. OOPS- The basic features of OOPS concept is

1.Abstraction

2.Encapsulation

3.Inheritance

4.Polymorphism

8.Pass by value means the copy of the argument will pass to the reference, but in pass by refernce the original value will pass.

   tomcat -> webapps->root->web-inf -> Then create a folder name as classes then placed you servlet class file.

  for jsp and html files you need to put those files in root folder.

Aj

  • Apr 23rd, 2006
 

hi fnz ,As far as i am concernd applets are java programs embedded in Web pages.When a Web page containing an applet is opened.the byte code of the applet is downloaded to the client cmputer.This process becomes time consuming if the size of the applet is too large.As servlets execute on the Web server the yhelp overcome the problems with download time faced while using applets.Servlets do not require the browser to be enabled unlike applets because they execute on Web Server and results are sent back to the client or the browser.

  Was this answer useful?  Yes

chaitanya choukidar

  • Aug 2nd, 2007
 

Basically inheritence means subclass inherit the features of his parent class as well as his own different additional features. The example is parents and child. The child have features from his mother and father as well as his own additional features.

single inheritence represents a class inherit the features from his superclass.

As far as multiple inheritence is concern, that is not allowed in java but we can achieve multiple inheritence through single inheritence.

  Was this answer useful?  Yes

from_sand

  • Dec 17th, 2008
 

Inheritance: Its a property of OOP languages by virtue of which a child(derived) class can inherit, readily use, override methods from its parent(base) class (or classes) under some circustances.Single inheritance: in JAVA only single inheritance is allowed, that is a class can have only one parent class. * single inheritance keeps JAVA simple yet powerful OOP language. * single inheritance keeps JAVA safe from Diamond problem. Multiple inheritance: A class can have more than one base class.

pijush

  • Dec 17th, 2008
 

In Java multiple inheritance means implementing the multiple interface, at the same time you can inherit only one class and implement multiple interface.

  Was this answer useful?  Yes

srinu141

  • Sep 22nd, 2009
 

Java supports single inheritance like C++, but does not supports multiple inheritance because of diamond problem.

  Was this answer useful?  Yes

Single inheritance is nothing but only one base class and one derived class.

Multiple inheritance has one derived and more than one base class.

Java does not provied multiple inheritance because in the base classes same method will be there if I derived ambiquite state will be there

In C++ scope resolution will take care all those things in Java no one will be there, that is why in place of multiple inheritance we replace with interface.

  Was this answer useful?  Yes

Chandra Mohan.C

  • Nov 8th, 2012
 

Single Inheritance:

It is sharing only a particular classes
Eg: Agents,Proker,join family .........

Multiple Inheritance:

It is also sharing with all classes.access specification is easy.
Eg:ATM card,money transfer...

Code
  1. single inheritance_code:

  2.  

  3. class A

  4. {

  5. void show()

  6. {

  7. s.o.pln("welcome");

  8. }

  9. }

  10. class B extends A

  11. {

  12. void display()

  13. {

  14. s.o.p("good");

  15. }

  16. }

  17. class C extends B

  18. {

  19. p s v main(String ar[])

  20. {

  21. C c1=new C();

  22. c1.show();

  23. c1.display();

  24. }

  25. //========================

  26. Multiple Inheritance:

  27.  

  28. interface inter

  29. {

  30. public void show();

  31. public void display();

  32. }

  33.  

  34. class A implements inter

  35. {

  36. void show()

  37. {

  38. s.o.p("hai");

  39. }

  40. }

  41. class B implements inter

  42. {

  43. void display()

  44. {

  45. s.o.p("hello");

  46. }

  47. }

  48. class C extends B

  49. {

  50. p s v main(String ar[])

  51. {

  52. C c1=new C();

  53. c1.display();

  54. }

  55. }

  56.  

  57.  

  58.  

  59.  

  60.  

  Was this answer useful?  Yes

harps

  • Nov 20th, 2012
 

Single Inheritance in Java means that a sub class have the capability of inheriting the properties of only one class whereas multiple inheritance is not supported by Java as it increases the complexity level of the code. Multiple inheritance is nothing but a sub class can inherit the feature of more than one class into it.

  Was this answer useful?  Yes

Inheritance :: Inheriting the properties and actions(methods) of Super class to Sub-class is the main concept of Inheritance. In java by using extends or implements are the two ways we can go for the inheritance.

Single Inheritance :: For example we are extending only one class or implementing only one interface then that is called single inheritance.

Multiple Inheritance :: Inheriting the properties and actions of two or more classes or interfaces is called multiple inheritance. In java multiple inheritance using extends keyword(For classes only) is not possible but for interfaces it is possible i.e by using implements keyword we can implement n number of interface.

Abstract class :: The class is a class which is having both the abstract methods(i.e methods without any implementation) and concrete methods(i.e the methods which is having the implementation). But interfaces are having only abstract methods.

Abstract method :: We are having method with out any implementation then that method is called as abstract method. For example see below
class A{
public abstract boolean isWorkDone();
}

If we observe the above method i.e isWorkDone() which is called as abstract method, So the classes which implements the above abstract class has to write the implementation code for isWorkDone();

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions