Procedure-oriented Programming-1)Focus is on procedures or functions rather than data.
2)A program
consists of a set of functions.3)It follows Top-Down approach.4)All functions can access the global
data.5)Less data security. Object-oriented Programming-1)Focus is on data rather than procedures or
functions.2)A program consists of a set of objects.3)It follows Bottom-up approach.4)Data is hidden and
can only be accessed through the object’s member functions.5)More data security.
Class-1)Represents a type 2)Blueprint for an object 3)Group of objects of similar type 4)No memory is
allocated for a class. Class is a logical [Link]: Vehicle. Object-1)Represents a real world entity
2)Instance of a class Belongs to a specific class 3)Memory is allocated for an object. 4)Object is a physical
[Link]: Scooter, car, bus are objects of class Vehicle.
Data type-1)Integer types: This group includes byte, short, int, and long, which represent signed Whole
numbers.2) Floating point types: This group includes float and double, which represent numbers With a
fractional part.3)Character Type: This group includes char, which represents a single 16-bit Unicode
character. Unicode defines a fully international character set that can represent all the Characters used in
all human languages.4)Boolean Type: This group includes boolean, which represents a logical type
having only two values – true and false. All relational, conditional and logical operators produce boolean
values.
Javac – the java compiler: The javac tool reads class and interface definitions, written the Java
programming language, and compiles them into bytecode class files. Javadoc – the java documentation
generator: The javadoc tool generates HTML pages of API documentation from Java source files. Java –
the application launcher : The java tool launches a Java application. It does this by starting the Java
runtime environment, loading a specified class, and invoking the main method in that class. Javap –
Disassembling classes: The javap tool allows you to query any class and find out its list of methods and
constants or find out the commands executed by the underlying JVM.
Comments in java-1)Single line comment: The single line comment begins with two front slashes i.e. //
characters. Anything after // till the end of the line is treated as a comment.2)Multiline comment:
Multiline comments starts with / and ends with /. This is C style Of commenting.3)Javadoc comment: It
starts with / and ends with /. These comments are used by the javadoc tool to create HTML
documentation and help files.
Arrays-An array in java is an object which stores a group of variables of the same type, referred to by a
common name.1)One-Dimensional Arrays-A one-dimensional array is a linear list of elements of the
same type. To create a one dimensional array.2)Multidimensional Arrays-In Java, multidimensional arrays
are actually arrays of arrays. Since an array is an object, array elements can themselves be array objects.
BufferedReader: [Link] is a predefined stream object which can be used to read input. However, this
is a byte oriented stream, i.e., we can read only bytes. To read characters, we should wrap this stream
into a character oriented stream like InputStreamReader. This lets us read characters. If we want to read
strings, wrap this stream into a class like BufferedReader which buffers characters.
Classes-A class defines a new type. The data members and the operations on the data are encapsulated
in a class. Once defined, this new type can be used to create objects of that [Link] of Classes-
1)Concrete class: A concrete class is a class which can be instantiated i.e. its objects can be created. 2)
Abstract class: An abstract class is an incomplete class which cannot be instantiated. It Often defines data
members, defines constructors, defines some methods, declares other Methods (leaving the definition
to subclass.3) Interface or pure abstract class: An interface is a pure abstract class. It simply declares the
methods. The methods are defined by the class or classes that implement the interface. It can contain
constants.4)Inner class: A class defined within another class is called as an inner class or nested class. An
inner class that does not have a name is called an anonymous inner class.
Constructor -A constructor Is a special method of the class which has the same name as the class. It is
used for initializing the data members of an object as soon as the object is [Link]-1)Default
Constructor: This is a constructor with no parameters. If you don’t define a constructor for a class, it is
automatically created by the compiler.2)Parameterized Constructor: The job of the parameterized
constructor is to assign values that are passed as function arguments to the data members of the object.
Wrapper Classes-Java is a pure object oriented language i.e. everything in Java is an object. But variables
of primitive data types are not objects. Hence they cannot be used with methods that require objects as
parameters or return objects. As a solution to this problem, Java provides Wrapper classes in The lang
package, which allow us to “wrap” primitive data type into an object. A wrapper class object
encapsulates a single value of a primitive type.
Packages-Package is an important and innovative concept in java. It is a naming and visibility cont
Mechanism.A package is a namespace that organizes a set of related classes and interfaces. A Packag
Allows classes and interfaces to be grouped together into a collection called “package”. Packages are
basically containers for classes to keep the class namespace compartmentalized.
Subclass -A subclass Is a class that extends another class. A subclass inherits state and behavior from all
of its ancestors. Type of intheritance-1)Single Inheritance: In this type of inheritance, a class can have
only one superclass i.e. it can be inherited from one class only. 2)Multilevel Inheritance: In multilevel
inheritance, a subclass is further used to derive More classes.3)Hierarchical Inheritance: A single
superclass class has one or more subclasses. These are further used to create more subclasses.
Dynamic binding -When methods are overridden in multilevel inheritance, java resolves calls to
overridden methods during runtime and not during compile-time. This is called dynamic linking, dynamic
binding or dynamic method dispatch.
Interface-1)Pure abstract class.2)It specifies functionality which a class should have.3)Contains only
method declarations.4)Fields are implicitly final and static.5)Cannot have constructor. Abstract class-
1)Incomplete class.2)It specifies common attributes and behavior that a class inherits.3)Contains method
declarations and definitions.4)Fields can be static, final as well as instance fields.5)Can have a
constructor.
Marker interface -Marker interface is used to tag a class so that some special behavior can be added to
the cla implementing it. Thus, a class that wants to allow its objects to be cloned (create an exact copy
must be tagged by the Cloneable interface. In such a case, the class must override the cloner) method
from the Object class so that its objects can be [Link] Interface-A functional interface is an
interface that contains only one abstract method. A functional interface can have any number of default
methods and static methods but can contain only one abstract [Link] Interface is also
known as Single Abstract Method Interfaces SAM Interfaces. This feature in Java, which helps to achieve
functional programming approach.