Skip to main content

Concept of OOPS

Java Programming

This are the basic concept of OOPS.

1. Object
2. Class
3. Data abstraction
4. Data encapsulation
5. Inheritance
6. Polymorphism
7. Dynamic binding


Java Classes/Objects

Java is an object-oriented programming language.
Everything in Java is associated with classes and objects, along with its attributes and methods. For example: in real life, a car is an object. The car has attributes, such as weight and color, and methods, such as drive and brake.
A Class is like an object constructor, or a "blueprint" for creating objects.

Create a Class

To create a class, use the keyword 
Myclass.java

Create an Object

In Java, an object is created from a class. We have already created the class named MyClass, so now we can use this to create objects.
To create an object of MyClass, specify the class name, followed by the object name, and use the keyword new:

Example=>
public class Myclass{
int x=10;
public static void main(string [] args){
Myclass myobj=new Myclass();
System.out.println(myobj.x);
}
}
Output :   5


Comments

Popular posts from this blog

Byte Code:

Java Programming Byte Code: It is the unique characteristic property of the Java programming language. It is something like a normal text file. Therefore, it cannot be affected by virus. It is an intermediate between a human readable source and machine readable source. Byte codes are plate form independent. Therefore, JVM is plate form dependent to make Java programming plate form indepdent.  

OPERATING SYSTEM

1.  The term 'operating system'   means: a)  the way a computer operator   works. b)  conversion of high level languages into machine   code. c)  a set of programs which controls computer   working. d)  none of the   above. 2.  What is the name of the operating system that reads and reacts in terms of actual   time: a)   Batch   system b) Time sharing system c) Real   time   system d) all of the above. 3.  The primary job of the operating system of a computer is   to: a)   command   resources b) manage   resources c) be   user friendly d) only one of the   above. 4.  Multiprogramming   systems: a) are easier to develop than single programming systems. b) execute more jobs in same time period. c) are used only on large   mainframe   computers. d) all of the above 5.  Which of the following is not an a...

DBMS LEARNING SHEET

                                                            Types of DATA Structured data are facts concerning objects and events. The most important structured data are numeric, character, and dates. Structured data are stored in tabular form. Unstructured data are multimedia data such as documents, photographs, maps, images, sound, and video clips. Unstructured data are most commonly found on Web servers and Web-enabled databases. Database A database is a collection of data that is organised in such a way that it provides efficient retrieval of desired information. This collected data could be in any format like printed, audio, electronic and graphic. Consider an example of an address book, it is also a database that provides information of personal contacts of persons. DBMS A Database Mana...