Java Programming Language and Concepts of OOPs
Source: Google
Introduction
Today we are going to see some concept of java okay
so here i have a ppt so first we will understand what is oops. oops it is
object-oriented programming and these concepts include you know data
abstraction encapsulation inheritance benefit of inheritance. we will see and
polymorphism how that overloading and overriding functions are there and these
all include some of them. okay so we have so what we know first we will see why
the need is of oops. okay so as we know oops by using the oops concept.
We can reduce the programming effort and it will be very, you know, easy for us or the programmer to understand. and it will be easy because using the concept of encapsulation we can combine the data and functions into classes and all that so we will later we will see on that part also so what is the definition of oops object-oriented program. It is a programming paragraph that uses objects and the interaction to design applications okay so there are some of the concepts which we have: objects classes abstraction and encapsulation inheritance polymorphism dynamic binding and message passing.
Java
So we will see one by one everything so what is
object see let's take an example of object is nothing. but let's say it is in
class when we have a class then it means. We have a prototype, and we can see
it as a blueprint and so that will be a class okay and the instance of that uh
you know that class will be an object. so, object it is a basic runtime entity
in object oriented programming.
It can be a place it can be a person, a bank
account or editor you know a variable or table of data so objects can be you
know like pen or keyboard. it is and what is class as we i already discussed
earlier class it is an entire set of data and the code of the object can be
made up of user defined data type which with the help of the class okay so
class is nothing, but a blueprint that we can use in our program okay so we
will see a program and we will do it practical as well so here i am opening the
eclipse so eclipse it is in compiler.
OOPs
Source: Google
Java as we know java is a pure you know
object-oriented programming so what it means. it means each and every code
which we are writing that will be in a class. okay so right now i have a class
class i have a file name which is experiment one. okay dot java java.java is a
extension for a java file okay so what we have to do we have to declare a you
know we know that there are three types of you like you know public protected
and uh private. These are the i i think that they are some of you know we will
see in the later on in this so that if we have to you know access a variable
outside a scope, so this public is used to define this copy.
It means throughout this program we can use
whatever we are describing in that public class we can use in every program.
Now class this is a you know to define a keyword so this is in class and let me
okay so then what we have we are declaring here the name of the our file the
exact same is okay we are opening parenthesis and closing parentheses. We have
now seen every program.
Java Code :
// Your First
Program
class HelloWorld {
public
static void main(String[] args) {
System.out.println("Hello,
World!");
}
}
Output
:
Hello, World!
Conclusion
we know they are different that you can see we have
the printf statement right. so, this is like java. In java we have a system so
in the system files or you can say library we have out and in print or you can
say we also have print alarm. we can use this also so this will print a line
and I’m doing this only and the string whichever the string or variable we want
to print here. We can just print here so we are printing you know string
variable so that's why we are using and you know what it is called as okay for
it first and then each and every statement after that we have to use the same
colour.
Code
your First program today with Java!
Written by Tarun Sikhwal
Comments
Post a Comment