Q1. why called pure object oriented language in java .
ans-> java is a purely
objecte oriented language due to the absence of global scope. everything in
java is an object, all the programme codes and data resides within classes and
objects. it come with an extensive set of classes, arranged in packages, object
model in java in sample and easy to extend. java is secured language because
it doesnt use pointer .
Q2. what are the main feature of java . ans-> * obeject oriented * platform
independent * simple * secured * architecture-neutral * portable * robust *
multithreaded * interpreted * high performance * distributed * dynamic
Q3. what is jdk / jvm. ans-> JDK:- jdk is an abbriviation for java devlopment
kit , it is a bundle of software devlopment tool and supporting libraries combines
with the java run time enviroment (jre) and java virtual machine(jvm). JVM:-
java vertual machine , or jvm , loads, verifies and execute java bytecode . it is
known as the interpreter or the core of java programming language beacause it
executes java programming.
Q4. how java is secure and portable . ans-> secure:- at it core, the java lan-
guage itself is type-safe and provides automatic garbage collection, enhancing
the robustness of application code. a secure class loading verification mechanism
and verification mechanism enssure that only legitimate java code is executed.
protable:- the java enviroment itself is readily prtable to new architecture and
operating system. the java compiler is written in java runtime system in written
ANSI c with a clean portablity boundary which is essentially posix-compliant.
Q5. what is constructer is java (inner class concept). ANS- a constructor in
java is a special method that is used to initalize objects. the consturctor is
called when object a class is created . it can be used to set intial value for
object attriibutes. inner class consept in java:- in java , inner class refer to the
class that is declared inside class or interface in which were mainly intorduced
, to sum up, same logically relatable classes as java is purely object-oriented so
bringing it closer to the real world , now greeks you must be wondeering why
they were introduced. types op inner class? # nested # method local ineer
class # static nested inner class. # anonymous ineer class.
Q6. what is a method overloading and method overriding . ANS:- 1:-method
overloading:- the class has two or more method in same name but different pa-
rameters, at the same of calling based on the parameter are passed respective
method is called ( and respective body are bounded with the calling line dynam-
ically ) this mechanism is known as method overloading. 2:-method overriding:-
in method overriding , super class and sub class have method with the same
name including parameters, jvm called the respective method based on the ob-
ject used the call the method in overriding , the return type should also be
same.
Q7. what is the use of super key , this key. ANS:- the super keyword refer
to super class (parent) objects. it is used to a call super class methods, and
to access the superclass constructor . the most commonn use of the super
1
keyword use is to eliminate the confusion betwen super class and subclasses
that have method with the same name. 2:# THIS KEY:- the this keyword refer
to a current object in a method or consructor. the most common use of this
keyword is to eliminate the confusion between
class attribute and parameter with the same name ( bacause a class attribute
is a shadowd by a method or constructor parameter) .
Q8 what is java language package . Ans:- JAVA PACKAGE :- a package is a
conatainer that group related types (java classes, interfaces,enumerations, and
annotation). for e.g. in core java in resultset interface belong to the java . sql
package the package contain all the related types thst are needed for the sql
querry and the database connection.
Q9. what is a inheritance ? explain there type what is access modifier. ANS:-
Iinheritance in java is a concept that acquires the properties from one class to
other classes; for e.g. the relationship between the fathe and son. inheritance in
java is a process of acquiring all the behaviours of the parents object. SYNTAX:-
class base { # code } class derive extend based { #code }
acess modifiers:-1 public 2 default 3 protected 4 private
Q10. what is abstract final class method . ANS:- a methods does not have
body is known as abstract method. it contain only method signature with
semicolon and an abstract keyword before it . public abstract mymethod(); to
use an abstract method, you need to inherit it by extending its class and provide
implementation to it.
Q11. what is a eception handling ? (throw ,throws , try , catch) Ans:- an ex-
ception is an errror evnet that can happen during the execution of a program
and disrupt its normal flow java provides a robust and object-oriented way to
handle exception scenarious knon as java exception handeling . 1 THROWS :-
the throws keyword is used to declare which exception can be thorown from a
methods. 2. THROW:- thow keyword used to declare which exception can be
thrown form a methods. while the throw keyword is used to explicitly throw an
exception within a method or block of code. [Link]:- one of the powerful mech-
anism to handle the run time error so that the normal flow of the application
maintained . [Link]:- the try catch is the simplest method of handdelling
execpetion.
Q12. what is a multithreaded and their life cycle (thread primity). ANS:- a
thread goes through various stage in its life cycle . e.g. threaded is born started
runs and then dies . the following diagram show the complete life cycle of a
thread begis its life cycle in the new state .
Q14. what is a applet life cycle ? ANS:- the applet life cycle can be defines as
the process of how the object is created , stopped , and destroyed during thye
entire execution of its application. it basically has five core methods namely
init(). start(), stop(), pain() and destroy(). these methods are invoked by the
browser to execute.
2
Q15. what is a event handeling ? ANS:- event handelling is the mechanism
that contorl the envent and decides what should happen if an event occors. the
mechanism have the code which is known as event handler that is executed when
an event occurs. java uses delegation event model to handle the events.
Q16. what is a string and array in java ? ANS:- array is a container object that
hold a fixed number of value of a single type. the length of an array is created
after creation, its length is fixed.