It's absolutely #freeofcost
GeeksforGeeks is organizing an 11-week workshop on Data structures and #Algorithms for FREE
isn't it the best thing that happened in 2020 #datastructures
#skill yourself up by enrolling in this wonderful course
Register here: https://practice.geeksforgeeks.org/courses/Workshop-DSA/
invite code: GFGY479GV
Hurry up!!! batch starting from tomorrow i.e 19 November 2020
Get Start Preparing for F.A.A.N.G. Companies...
@interviewprep2021
@interviewprep2021
@freshersoffcampjobs
@freshersoffcampjobs
GeeksforGeeks is organizing an 11-week workshop on Data structures and #Algorithms for FREE
isn't it the best thing that happened in 2020 #datastructures
#skill yourself up by enrolling in this wonderful course
Register here: https://practice.geeksforgeeks.org/courses/Workshop-DSA/
invite code: GFGY479GV
Hurry up!!! batch starting from tomorrow i.e 19 November 2020
Get Start Preparing for F.A.A.N.G. Companies...
@interviewprep2021
@interviewprep2021
@freshersoffcampjobs
@freshersoffcampjobs
www.geeksforgeeks.org
Placement 360 Course - Complete Tech Interview Prep
Master coding, Data Structures and Algorithms, core Computer Science subjects, Low-Level Design, and interview preparation with Placement 360, an AI-powered placement program designed to make you job-ready.
Java Interview Question ::
Q-1 Explain public static void main(String args[]).
โ public : Public is an access modifier, which is used to specify who can access
this method. Public means that this Method will be accessible by any Class.
โ static : It is a keyword in java which identifies it is class based i.e it can be
accessed without creating the instance of a Class.
โ void : It is the return type of the method. Void defines the method which will
not return any value.
โ main: It is the name of the method which is searched by JVM as a starting
point for an application with a particular signature only. It is the method
where the main execution occurs.
โ String args[] : It is the parameter passed to the main method.
Q-2. Why Java is platform independent?
Platform independent practically means โwrite once run anywhereโ. Java is called so
because of its byte codes which can run on any system irrespective of its underlying
operating system.
Q-3. Why java is not 100% Object-oriented?
Java is not 100% Object-oriented because it makes use of eight primitive datatypes
such as boolean, byte, char, int, float, double, long, short which are not objects.
Q-4. What do you mean by Object?
An object consists of methods and class which depict its state and
perform operations. A java program contains a lot of objects instructing
each other their jobs. This concept is a part of core java.
Q-5 What is association?
Association is a relationship where all object have their own lifecycle and there is no
owner. Letโs take an example of Teacher and Student. Multiple students can
associate with a single teacher and a single student can associate with multiple
teachers but there is no ownership between the objects and both have their own lifecycle. These relationship can be one to one, One to many, many to one and many
to many.
Q-6. What do you mean by aggregation?
Aggregation is a specialized form of Association where all object have their own
lifecycle but there is ownership and child object can not belongs to another parent
object. Letโs take an example of Department and teacher. A single teacher can not
belongs to multiple departments, but if we delete the department teacher object will
not destroy.
Q-7. What is composition in Java?
Composition is again specialized form of Aggregation and we can call this as a
โdeathโ relationship. It is a strong type of Aggregation. Child object dose not have
their lifecycle and if parent object deletes all child object will also be deleted. Letโs
take again an example of relationship between House and rooms. House can contain
multiple rooms there is no independent life of room and any room can not belongs to
two different house if we delete the house room will automatically delete.
Q-8. What's the difference between an array and Vector?
Ans: An array groups data of same primitive type and is static in nature while
vectors are dynamic in nature and can hold data of different data types.
Q-9. What is multi-threading?
Ans: Multi threading is a programming concept to run multiple tasks in a
concurrent manner within a single program. Threads share same process stack
and running in parallel. It helps in performance improvement of any program.
Q-10. Why Runnable Interface is used in Java?
Ans: Runnable interface is used in java for implementing multi threaded
applications. Java.Lang.Runnable interface is implemented by a class to support multi threading
Q-1 Explain public static void main(String args[]).
โ public : Public is an access modifier, which is used to specify who can access
this method. Public means that this Method will be accessible by any Class.
โ static : It is a keyword in java which identifies it is class based i.e it can be
accessed without creating the instance of a Class.
โ void : It is the return type of the method. Void defines the method which will
not return any value.
โ main: It is the name of the method which is searched by JVM as a starting
point for an application with a particular signature only. It is the method
where the main execution occurs.
โ String args[] : It is the parameter passed to the main method.
Q-2. Why Java is platform independent?
Platform independent practically means โwrite once run anywhereโ. Java is called so
because of its byte codes which can run on any system irrespective of its underlying
operating system.
Q-3. Why java is not 100% Object-oriented?
Java is not 100% Object-oriented because it makes use of eight primitive datatypes
such as boolean, byte, char, int, float, double, long, short which are not objects.
Q-4. What do you mean by Object?
An object consists of methods and class which depict its state and
perform operations. A java program contains a lot of objects instructing
each other their jobs. This concept is a part of core java.
Q-5 What is association?
Association is a relationship where all object have their own lifecycle and there is no
owner. Letโs take an example of Teacher and Student. Multiple students can
associate with a single teacher and a single student can associate with multiple
teachers but there is no ownership between the objects and both have their own lifecycle. These relationship can be one to one, One to many, many to one and many
to many.
Q-6. What do you mean by aggregation?
Aggregation is a specialized form of Association where all object have their own
lifecycle but there is ownership and child object can not belongs to another parent
object. Letโs take an example of Department and teacher. A single teacher can not
belongs to multiple departments, but if we delete the department teacher object will
not destroy.
Q-7. What is composition in Java?
Composition is again specialized form of Aggregation and we can call this as a
โdeathโ relationship. It is a strong type of Aggregation. Child object dose not have
their lifecycle and if parent object deletes all child object will also be deleted. Letโs
take again an example of relationship between House and rooms. House can contain
multiple rooms there is no independent life of room and any room can not belongs to
two different house if we delete the house room will automatically delete.
Q-8. What's the difference between an array and Vector?
Ans: An array groups data of same primitive type and is static in nature while
vectors are dynamic in nature and can hold data of different data types.
Q-9. What is multi-threading?
Ans: Multi threading is a programming concept to run multiple tasks in a
concurrent manner within a single program. Threads share same process stack
and running in parallel. It helps in performance improvement of any program.
Q-10. Why Runnable Interface is used in Java?
Ans: Runnable interface is used in java for implementing multi threaded
applications. Java.Lang.Runnable interface is implemented by a class to support multi threading