Vous êtes sur la page 1sur 2

A java constructor has the same name as the name of the class to which it

belongs. Constructor’s syntax does not include a return type, since constructors
never return a value.

this is a reference to the current class


super is a reference to the super class of the current class (the class from which this class
extends).
private variables cannot be accessed in a inherited class by using "this",where as by using
"super" we can easily access the private variables in its super class.

Final keyword is used for define constant variables and method and no body can change that
variable and method within program.Final class cannot be extended. Final method cannot be
overriden and value of final variable cannot be changed

Native is a Java keyword that is used in method declarations to specify.... This keyword
signals to the Java compiler that the function is a native language
Default Constructor

A constructor that takes no parameters is called a default constructor.

Default constructor :- There is no parameters.


Parameterised constructor. :- they have single or more then one paramertised
constructor.

An action event occurs, whenever an action is performed by the user. Examples: When the user
clicks a button, chooses a menu item, presses Enter in a text field. The result is that an
actionPerformed message is sent to all action listeners that are registered on the relevant
component.

Since the method in the child class has the same signature & name as the method of its parent
class, it is termed as overriding.

Package:
A Java package is a set of classes which are grouped together.
Every class is part of some package.
All classes in a file are part of the same package.

Java is a object oriented programming language which uses classes and methods.
A java class consists of methods and variables. Methods holds function of the class.

Object-oriented programming (OOP) is a programming language model organized around


"objects" rather than "actions" and data rather than logic. Historically, a program has been
viewed as a logical procedure that takes input data, processes it, and produces output data.An
object language is a language which is the "object" of study in various fields including logic,
linguistics, mathematics and theoretical computer science. The language being used to talk about
an object language is called a metalanguage. An object language may be a formal or natural
language.

The String class provides two methods that allow you to search a string for a specified character
or substring: • indexOf( ) Searches for the first occurrence of a character or substring.

startsWith(String start):
This is a Boolean type method that returns either 'true' or 'false'. It checks the given
string that begins with specified string in the beginning. It takes a string type
parameter

There are 8 primitive data types: byte, short, int, long, float, double, boolean, char
any other data type in Java can be considered non primitive data type. String data type can also
be known as the primitive data type

Vous aimerez peut-être aussi