Share on Google+Share on Google+

K Hari Prasad
Java abstraction
1 Answer(s)      8 years ago
Posted in : Java Beginners

Ads

View Answers

September 10, 2008 at 3:41 PM


Hi,


Abstract Class

Abstract classes are those that works only as the parent class or the base class. Subclasses are derived to implement the methods inherited from the abstract class (base class). Abstract classes are not instantiated directly. First extend the base class and then instantiate (create objects). Abstract classes are generic in nature and implement to those methods that are used commonly by the subclasses with common implementation. Abstract classes .


abstract class FindArea {

public String color;
public FindArea() {
}
public void setColor(String c) {
color = c;
}
public String getColor() {
return color;
}
abstract public double area();
}

-----------------------


public class CulculatePoint extends FindArea {

static int x, y;
public CulculatePoint() {
x = 10;
y = 15;
}
public double area() {
return 0;
}
public double perimeter() {
return 0;
}
public static void print() {
System.out.println("point: " + x + "," + y);
}
public static void main(String args[]) {
CulculatePoint cpoint = new CulculatePoint();
cpoint.print();
}
}



------------------------------------------


For read more information.

http://www.roseindia.net/java/master-java/abstract-class.shtml

Thanks.

Amardeep









Related Tutorials/Questions & Answers:
Java abstraction - Java Beginners
Java abstraction  Is abstraction and abstract class are related ar same
Abstraction In Java for Java beginners
Abstraction In Java for Java beginners  Hi, As a beginner in Java I am looking for good tutorial that explains the Abstraction concept in Java... of Abstraction in Java? Thanks   Hi, What is abstraction in Java
Advertisements
Abstraction : Java Glossary
Abstraction : Java Glossary   ...: -- Abstraction in Java allows the user to hide non-essential details relevant... class. Tutorials on Abstraction Abstraction in Java 7 Abstraction in Java
Abstraction In Java
Abstraction In Java In this section we will read about the abstraction in Java. Java is an Object Oriented Programming language and Abstraction is one of the feature of OOPs i.e. Java has the feature of abstraction. In Java abstraction
What is Abstraction - Java Beginners
What is Abstraction  What is abstraction in java? How is it used in java..please give an example also  Hi Friend, Abstraction is nothing but data hiding.It involves with the dealing of essential information
Abstraction in java - Java Interview Questions
Abstraction in java  Abstraction in java - I know its a very basic question that i can find anywhere else as well... but i am looking for a description as well as an example on Abstraction in java. can anyone
Java abstraction - Java Beginners
Java abstraction  what is abstraction in java please explain...(); } } ------------------------------------------ For read more information. http://www.roseindia.net/java/master-java/abstract-class.shtml Thanks. Amardeep
Java Abstraction - Java Beginners
Java Abstraction  If we declare a class as abstract then it contains... Friend, Please visit the following links: http://www.roseindia.net/java/master-java/abstract-class.shtml http://www.roseindia.net/help/java/a/java-abstract
Java Abstraction - Java Beginners
Java Abstraction  suppose we have an interface & that interface contains five methods. if a class implements that interface then we have to bound that to give tha definition of all five methods in that class. If we declare
Abstraction in Java
Abstraction in Java Abstraction is one of the four pillar of OOPS Concept. Abstraction in java is a process by which hiding the irrelevant data  and exposing only the essential feature of object. In java Abstraction
How to make query and abstraction in Java
How to make query and abstraction in Java  Hi, I read the lessons... write. I am very beginner in Java I don't know anything in it. I am using PostgreSQL database, and I want to make a query and abstraction for a table. Could
abstraction
abstraction  give a simple example program for abstraction   public class Animal { double energyReserves; boolean isHungry() { return... is an abstraction used in place of an actual animal
abstraction
abstraction  give a simple example program for abstraction  ... is an abstraction used in place of an actual animal.*/   public class Animal...); } } } /*In the above example, the class Animal is an abstraction used in place
Encapsulation & Abstraction - Java Interview Questions
Encapsulation & Abstraction  What is the difference between Encapsulation and Abstraction
Encapsulation & Abstraction - Java Interview Questions
Encapsulation & Abstraction  What is the difference between Encapsulation and Abstraction
ABSTRACTION AND INTERFACE - Java Interview Questions
ABSTRACTION AND INTERFACE  When Use Abstract?When Use Interface ?I... the following links: http://www.roseindia.net/help/java/a/abstract-keyword.shtml http://www.roseindia.net/java/master-java/interface.shtml Thanks
Encapsulation VS Abstraction - Java Beginners
(); } Abstraction-The process of abstraction in Java is used to hide certain details...Encapsulation VS Abstraction  Real Time sample code for Encapsulation and Abstraction. where to use abstract and where to use specifies like public
OOPS Concept Abstraction with example - Java Beginners
OOPS Concept Abstraction with example  I am new to java. In java... it with one example  Hi Friend, The process of abstraction in Java is used...). For example, the Java Collections Framework defines the abstraction called
classes and data abstraction - Java Beginners
classes and data abstraction  Create a java program for a class named... for Mexican pesos, f for Swiss francs, e for Euro dollars or q to quit...() is called. If the user enters 'q', the data member more is set to false to allow
Abstraction in Java 7
Abstraction in Java 7 This section elaborate about abstraction. It is one of OOPs concept. Abstraction :  Abstraction means hiding the unnecessary... or object.  In java, you can see concept of abstraction whenever you use
Difference between Encapsulation and Abstraction in Java
and Abstraction in Java. Encapsulation is a process of hiding all the data and methods within a class from outside world. Abstraction on the other hand.... Abstraction in Java is represented by Interface, Abstract class, Abstract methods
Abstraction in flex
Abstraction in flex  Hi... What keyword allows you to implement abstraction better? please tell me about it.... Thanks   Ans: Flex does not support abstart class directly. Thanks
encapsulation vs abstraction
encapsulation vs abstraction  what is the difference between encapsulation and abstraction
diff between encapsulation and abstraction code
diff between encapsulation and abstraction code  diff between encapsulation and abstraction code
Spring Abstraction with Redis
Spring Abstraction with Redis  Hi.. I have implemented @Cacheable for one method like @Cacheable("parameter1") public String getCompaniesList(String parameter1, String parameter2) throws Exception { //code
diff between encapsulation and abstraction code with output
diff between encapsulation and abstraction code with output   diff between encapsulation and abstraction code with output
diff between encapsulation and abstraction code with output
diff between encapsulation and abstraction code with output   diff between encapsulation and abstraction code with output
diff between encapsulation and abstraction code with output
diff between encapsulation and abstraction code with output   diff between encapsulation and abstraction code with output
how to do abstraction for insurance policy being issued...
how to do abstraction for insurance policy being issued...  an insurance policy is being insured.... now what will be the classes for policy and how to do abstraction of the same
Java Data Objects
Java Data Objects       The Java Data Objects (JDO) API is a specification of Java model abstraction of persistence, that is developed under the supervision of the Java Community
Java beginner - Java Beginners
Java beginner  what is the diffrence between abstraction and interface? with coding
Tutorials   
Java Spring Hibernate Struts Training What does core Java include? java What are some way to learn Java quickly? Is it required to learn Java before learning Java Script? Is it necessary to learn java script before learning PHP? Are HTML5 and Java Script boosts Java career? Is Java object oriented? Fingerprint application with Java Uninstall Oracle Virtual Box JSON to HashMap Free Java online Training I want example of Control Statement in Java ANSI Color Codes with Python Create a Program that Calculates Input What is difference between JDK,JRE and JVM? How to see ubuntu version on server? How to get Page Source in Selenium (WebDriver) using Java? The path to the driver executable must be set by the webdriver.gecko.driver system property parse data from a link in java Java Program Qns using BlueJ How to fix HAX Kernel Module Is Not Installed error? Installing Audacity Looking for code Logic to check track changes & Coments in MSWord, MSWordx, MSExcel, MSExcelx is ON/OFF Installing JDK on Mac SAX Parser exception ERROR 601 (42P00): Syntax error. Encountered Thread java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileItemFactory How to install Ubuntu 16.04 LTS? HttpServletRequest cannot be resolved to a type in eclipse - Solved Unhandled event loop exception GC overhead limit exceeded Spring Data jpa with apache phoenix Caused by: java.lang.IllegalArgumentException: Not a host:port pair: PBUF o.a.h.h.z.RecoverableZooKeeper - Possibly transient ZooKeeper, quorum= com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager class not found com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager not found How to download and install Java 8 on Windows? How to uninstall JDK 7? How to install gtk-doc-tools package in Ubuntu? How to install Oracle JDK 8 on Ubuntu? ejabberd_ctl.beam not found - Solved How to convert date to UTC format in Java? How to install autoconf, automake and libtool in Ubuntu 15.10? How to convert current date to mm dd yyyy format in Java? How to convert current date to dd mm yyyy format in Java? How to stop window closing in "internalFrameClosing" event. How to find list of all index in Neo4j? neo4j-server.properties file location SASLError using PLAIN: not-authorized how to convert war file into .exe file using java code

Ads

 
Advertisement null

Ads