SlideShare a Scribd company logo
1 of 11
Download to read offline
What is Polymorphism?
The Polymorphism can be referred as one name many forms. It is the ability of methods to behave
differently, depending upon the object who is calling it. The key features of Polymorphism are:
Allows using one interface for multiple implementations.
Supports Method Overloading: Multiple methods with same name, but different formal argument.
Supports Method Overridden: Multiple methods have the same name, same return type, and same
formal argument list.
Explain garbage collection.
The Java uses the garbage collection to free the memory. By cleaning those objects that is no longer
reference by any of the program. Step involve in cleaning up the garbage collection:
Garbage Object Collection: first step is to collection and group all those object which are no more
reference with any of the program. We can use the different methods to collect the garbage object
like using runtime.gc() or system.gc().
Run Finalize method: To free up those object which is collected by the garbage collector java must
execute the Finalize method to delete all those dynamically created object
What is an immutable object?
An immutable object is one that we cannot change once it is created. Steps involved in creation of
an immutable object are:
Make all of its data fields private.
Methods which can perform changes in any of the data fields after the construction of object must
be avoided.
How are this() and super() used with constructors?
this() Constructors: is used to pointing the current class instance.
Can be used with variables or methods.
Used to call constructer of same class.
Private variable cannot be accessed using this().
super() Constructer: is used to call constructor of parent class.
Must be the first statement in the body of constructor.
Using this we can access private variables in the super class.
What are Access Specifiers available in Java?
Java offers four access specifiers, described below:
Public: public classes, methods, and fields can be accessed by every class.
Protected: protected methods and fields can only be accessed within the same class to which the
methods and fields belong.
Default (no specifier): when we do not set access to specific level, then such a class, method, or field
will be accessible from inside the same package to which the class, method, or field belongs.
Private: private methods and fields can only be accessed within the same class to which the methods
and fields belong. Private methods and fields are not inherited by subclasses.
What is Constructor?
A constructor is used to initialize a newly created object.
It is called just after the memory is allocated for the object.
It can be used to initialize the objects.
It is not mandatory to write a constructor for the class.
Name of constructor is same as the class name.
Cannot be inherited.
Constructor is invoked whenever an object of its associated class is created.
What are the List interface and its main implementation?
The List helps in collections of objects. Lists may contain duplicate elements. The main
implementations of the List interface are as follows:
ArrayList: Resizable-array implementation of the List interface.
Vector: Synchronized resizable-array implementation of the List.
LinkedList: Doubly-linked list implementation of the List interface. Better performance than the
ArrayList implementation when elements are inserted or deleted timely.
Explain the user defined Exceptions.
User Defined Exceptions are exceptions defined by the user for specific purposed. This allows
custom exceptions to be generated and caught in the same way as normal exceptions. While
defining a User Defined Exception, we need to take care of the following aspects:
It should be extend from Exception class.
Use toString() method to display information about the exception.
Describe life cycle of thread.
Threads follow the single flow of control. A thread is execution in a program. The life cycles of
threads are listed below:
Newborn state: After the creations of Thread instance the thread is in this state but before the
start() method invocation. Thread is considered not alive in this phase.
Runnable state: A thread starts its life from Runnable state. After the invoking of start() method
thread enters Runnable state.
Running state: A thread first enters Runnable state.
Blocked state: A thread can enter in this state because of waiting the resources that are hold by
another thread.
Dead state: A thread can be considered dead when its run() method completes. If any thread comes
on this state that means it cannot ever run again.
What is an Applets?
Applets: These are small java programs.
They can send from one computer to another computer over the internet using the Applet Viewer
that supports java.
Applets can runs in a Web browser as it is a java program. It can be a fully functional Java application
because it has the entire Java API at its disposal.
Applets follow the security rules given by the Web browser.
Applet security is also known as sandbox security.
What is the Set interface?
A Set interface is collection of element which cannot be duplicated.
The Set interface contains methods inherited from collection.
It provides methods to access the elements of a finite mathematical set.
Two Set objects are equal if they contain the same elements.
It models the mathematical set abstraction.
What is a HashSet and TreeSet?
The HashSet is an unsorted, unordered Set.
It is Collection set that restrict duplicate elements and also repositioning of elements.
It implements the Set interface and extends AbstractSet.
Uses hash code of the object being inserted.
The TreeSet is a Set implemented when we want elements in a sorted order.
Sorting of element is done according to the natural order of elements or by the help of comparator
provided at creation time.
How do you decide when to use HashMap and when to use TreeMap and what is difference
between these two?
HashMap is used when we want to perform insertion, deletion, and locate elements in a Map.
TreeMap is used when we want to traverse the elements in a sorted order. Depending upon the size
of collection, adding elements to HashMap is easy. For sorted elements traversal we can convert the
HashMAp into TreeMap.
HashMap:
Lets us to have null values and also one null key
Iterator in the HashMap is Fail-Safe.
It is Unsynchronized.
HashTable:
It does not allow null value as key and value.
It is not synchronized.
What is the Comparable interface?
The Comparable interface is used to sort collections and arrays of objects using the collections.sort()
and java.utils. The objects of the class implementing the Comparable interface can be ordered. All
classes implementing the Comparable interface must implement the compareTo() method that has
the return type as an integer. The signature of the compareTo() method is as follows:
int i = object1.compareTo(object2)
If object1 < object2: The value of i returned will be negative.
If object1 > object2: The value of i returned will be positive.
If object1 = object2: The value of i returned will be zero.
When should I use abstract classes and when should I use interfaces?
Use Interface, when:
Design changing frequently or when various implementations only share method signatures.
We need some classes to use some methods which we do not want to be included in the class.
Use Abstract Class, when:
Various implementations are of the same kind and use common behavior.
Enabling with generalized form of abstraction and leave the implementation task with the inheriting
subclass.
creating planned inheritance hierarchies
Explain the Polymorphism principle.
The Polymorphism can be referred as one name many forms. It is the ability of methods to behave
differently, depending upon the object who is calling it. Polymorphism exists in three distinct forms
in Java:
Method overloading
Method overriding through inheritance
Method overriding through the Java interface
What are the difference between throw and throws?
The differences are between throw and throws are:
Throw is used to trigger an exception where as throws is used in declaration of exception.
Without throws, Checked exception cannot be handled where as checked exception can be
propagated with throws.
Throw is used inside the method where as throws is used with the method signature.
Throw is followed by an instance but throws is followed by class.
What is difference between preemptive scheduling and time slicing?
Differences between preemptive and time scheduling are:
In Preemptive scheduling the highest priority task executes until it enters the waiting or dead stated
or a higher priority task comes into existence.
Time slicing, a task executes for a predefined time period and then the pool of ready tasks. The
scheduler then determines which task should execute next, based on priority and other factor.
Explain traversing through a collector using Iterator.
Ans. We can access each element in the Collection by using Iterators irrespective of how they are
organized in the collector. Iterator can be implemented a different way for every Collection. To use
an iterator to traverse through the contents of a collection we do:
Obtain an iterator by calling the collections iterator()method to the start of the collection.
Set up a loop that makes a call to hasNext(). Have the loop iterate as long as hasNext()returns true.
Within the loop, obtain each element by calling next().
remove() method is used to remove the current element in the iteration.
What are the principle concepts of OOPS?
There are four principle concepts upon which object oriented design and programming rest. They
are:
Abstraction: Abstraction refers to the act of representing essential features without including the
background details or explanations.
Polymorphism: is the ability to create a variable, a function, or an object that has more than one
form.
Inheritance: Inheritance is the process by which objects of one class acquire the properties of
objects of another class.
Encapsulation: Encapsulation is a technique used for hiding the properties and behaviors of an
object and allowing outside access only as appropriate. It prevents other objects from directly
altering or accessing the properties or methods of the encapsulated object.
What are the basic features of java?
The basic features of Java are given below :
• Java is simple.
• Java provides immense security.
• Java provides high portability.
• Java provides object oriented programming features
• Java provides robustness.
• Java is multuthreaded.
• Java provides architecture neutrality.
• Java is distributed
• Java is dynamic.
How java becomes object oriented?
• Java follows the paradigm of OO programming.
• Java follows modular approach.
• Java follows the abstraction aspect.
• Java follows the OO principle encapsultaion.
• Java follows the OO principle polymorphism.
• Java follows the OO principle inheritance.
How java becomes robust?
• Java provides multi-platformed environment.
• Java provides high reliability in the design.
• Java is a strictly typed language.
• Java checks the code at runtime.
• Java provides predictablity.
• java provides various keywords.
How a Java program compiles?
• First the source file name must be extended with .java extension. e.g. Myprog.java
• Execute the javac compiler.
• javac compiler creates a file called Myprog.class i.e. the bytecode version of Myprog.java.
• The butecode is executed by the Java runtime-systems which is called Java Virtual Machine (JVM).
• JVM is platform dependent.
What is 'public static void main ( String args[ ] ) ' signifies?
• the access specifier is the 'public' keyword .
• 'static' keyword allows main() to be called without instantiating a particular instance of a class.
• 'void' affirns the compiler that no value is returned by main().
• 'main()' mathod is called at the beginning of a Java program.
• 'String args()' tells a parameter named args,which is an instance array of class String
What 'System.out.println()' signifies?
• 'System' is a predefined class .
• System class givesacces to the system.
• 'out' is the output stream.
• 'println' is printing the line on the console.
• This is a console output statement.
What is a variable in Java program?
• It's a memory location.
• The memory location is given some name.
• The memory location is being assigned some value.
• The value may change of the variable.
• The memory location size changes with the type of the variable.
What is JVM?
• JVM is the acronym stands for 'Java virtual machine'.
• JVM provides the execution environment.
• JVM is not platform independent..
• JVM is the Java run-time system.
• JVM is an interpreter of bytecode.
• JVM also makes the sytem secured.
What is bytecode?
• Bytecode is an instruction set.
• Bytecode extends wiith .class.
• 'javac' compiler translates the .java file into .class.
• JVM interpretes bytecode.
• Bytecode facility makes Java platform-independent.
• It also confirms security tothe Java code.
What is Java applet?
• Applet is a java program.
• It has been designed for transmitting the Java code over the internet.
• It is automatically executed by Java-enabled Web Browser.
• Applet can repnse to the user input.

More Related Content

What's hot

Java Unit 2 (Part 2)
Java Unit 2 (Part 2)Java Unit 2 (Part 2)
Java Unit 2 (Part 2)SURBHI SAROHA
 
OCA Java SE 8 Exam Chapter 3 Core Java APIs
OCA Java SE 8 Exam Chapter 3 Core Java APIsOCA Java SE 8 Exam Chapter 3 Core Java APIs
OCA Java SE 8 Exam Chapter 3 Core Java APIsİbrahim Kürce
 
Joshua bloch effect java chapter 3
Joshua bloch effect java   chapter 3Joshua bloch effect java   chapter 3
Joshua bloch effect java chapter 3Kamal Mukkamala
 
Object and Classes in Java
Object and Classes in JavaObject and Classes in Java
Object and Classes in Javabackdoor
 
Javainterview
JavainterviewJavainterview
JavainterviewAmarjit03
 
Chapter 02: Classes Objects and Methods Java by Tushar B Kute
Chapter 02: Classes Objects and Methods Java by Tushar B KuteChapter 02: Classes Objects and Methods Java by Tushar B Kute
Chapter 02: Classes Objects and Methods Java by Tushar B KuteTushar B Kute
 
OCA Java SE 8 Exam Chapter 4 Methods Encapsulation
OCA Java SE 8 Exam Chapter 4 Methods EncapsulationOCA Java SE 8 Exam Chapter 4 Methods Encapsulation
OCA Java SE 8 Exam Chapter 4 Methods Encapsulationİbrahim Kürce
 
Chapter 7 - Defining Your Own Classes - Part II
Chapter 7 - Defining Your Own Classes - Part IIChapter 7 - Defining Your Own Classes - Part II
Chapter 7 - Defining Your Own Classes - Part IIEduardo Bergavera
 
Unit3 part3-packages and interfaces
Unit3 part3-packages and interfacesUnit3 part3-packages and interfaces
Unit3 part3-packages and interfacesDevaKumari Vijay
 
Ruby Metaprogramming
Ruby MetaprogrammingRuby Metaprogramming
Ruby MetaprogrammingWei Jen Lu
 

What's hot (20)

Java Unit 2 (Part 2)
Java Unit 2 (Part 2)Java Unit 2 (Part 2)
Java Unit 2 (Part 2)
 
Generics in java
Generics in javaGenerics in java
Generics in java
 
Hemajava
HemajavaHemajava
Hemajava
 
OCA Java SE 8 Exam Chapter 3 Core Java APIs
OCA Java SE 8 Exam Chapter 3 Core Java APIsOCA Java SE 8 Exam Chapter 3 Core Java APIs
OCA Java SE 8 Exam Chapter 3 Core Java APIs
 
Java unit 7
Java unit 7Java unit 7
Java unit 7
 
Joshua bloch effect java chapter 3
Joshua bloch effect java   chapter 3Joshua bloch effect java   chapter 3
Joshua bloch effect java chapter 3
 
Object and Classes in Java
Object and Classes in JavaObject and Classes in Java
Object and Classes in Java
 
Javainterview
JavainterviewJavainterview
Javainterview
 
Unit3 part1-class
Unit3 part1-classUnit3 part1-class
Unit3 part1-class
 
JVM and OOPS Introduction
JVM and OOPS IntroductionJVM and OOPS Introduction
JVM and OOPS Introduction
 
Autoboxing And Unboxing In Java
Autoboxing And Unboxing In JavaAutoboxing And Unboxing In Java
Autoboxing And Unboxing In Java
 
Advanced core java
Advanced core javaAdvanced core java
Advanced core java
 
Wrapper classes
Wrapper classesWrapper classes
Wrapper classes
 
Chapter 02: Classes Objects and Methods Java by Tushar B Kute
Chapter 02: Classes Objects and Methods Java by Tushar B KuteChapter 02: Classes Objects and Methods Java by Tushar B Kute
Chapter 02: Classes Objects and Methods Java by Tushar B Kute
 
OCA Java SE 8 Exam Chapter 4 Methods Encapsulation
OCA Java SE 8 Exam Chapter 4 Methods EncapsulationOCA Java SE 8 Exam Chapter 4 Methods Encapsulation
OCA Java SE 8 Exam Chapter 4 Methods Encapsulation
 
Chapter 7 - Defining Your Own Classes - Part II
Chapter 7 - Defining Your Own Classes - Part IIChapter 7 - Defining Your Own Classes - Part II
Chapter 7 - Defining Your Own Classes - Part II
 
Unit3 part3-packages and interfaces
Unit3 part3-packages and interfacesUnit3 part3-packages and interfaces
Unit3 part3-packages and interfaces
 
2.oop concept
2.oop concept2.oop concept
2.oop concept
 
Java Basics
Java BasicsJava Basics
Java Basics
 
Ruby Metaprogramming
Ruby MetaprogrammingRuby Metaprogramming
Ruby Metaprogramming
 

Viewers also liked

Atelier 4 l'expérience de la colo 3 g - clément bouhelier
Atelier 4   l'expérience de la colo 3 g - clément bouhelierAtelier 4   l'expérience de la colo 3 g - clément bouhelier
Atelier 4 l'expérience de la colo 3 g - clément bouhelieradaka01
 
Behaviorism and education prezentacja webquest
Behaviorism and education prezentacja webquestBehaviorism and education prezentacja webquest
Behaviorism and education prezentacja webquestswatka94
 
082-JLS-S3-083-ATENA-PROMOTIONS
082-JLS-S3-083-ATENA-PROMOTIONS082-JLS-S3-083-ATENA-PROMOTIONS
082-JLS-S3-083-ATENA-PROMOTIONSA. Rahehagh
 
Croquis presentation internet
Croquis presentation internetCroquis presentation internet
Croquis presentation internetadaka01
 
Resume - Perkins James.docx-2014
Resume - Perkins James.docx-2014Resume - Perkins James.docx-2014
Resume - Perkins James.docx-2014James Perkins
 
Franceagrimer rapport d'activite année 2014
Franceagrimer rapport d'activite année 2014Franceagrimer rapport d'activite année 2014
Franceagrimer rapport d'activite année 2014FranceAgriMer
 
Imentra conseil - Offre IMMO-PLANNER
Imentra conseil - Offre IMMO-PLANNERImentra conseil - Offre IMMO-PLANNER
Imentra conseil - Offre IMMO-PLANNERMarieAudeMillet
 
15 conseils efficaces_pour_rendre_votre_site_internet_plus_agreable
15 conseils efficaces_pour_rendre_votre_site_internet_plus_agreable15 conseils efficaces_pour_rendre_votre_site_internet_plus_agreable
15 conseils efficaces_pour_rendre_votre_site_internet_plus_agreableGouarir Chaker
 
Life and Work of Salim Ali
Life and Work of Salim AliLife and Work of Salim Ali
Life and Work of Salim AliSHOKIT POSWAL
 
Behaviorism and education
Behaviorism and education Behaviorism and education
Behaviorism and education swatka94
 
Bien réussir votre étude de couverture WiFi
Bien réussir votre étude de couverture WiFiBien réussir votre étude de couverture WiFi
Bien réussir votre étude de couverture WiFiSyNAP Services
 
Conception de Réseau WiFi avec AirMagnet Planner
Conception de Réseau WiFi avec AirMagnet PlannerConception de Réseau WiFi avec AirMagnet Planner
Conception de Réseau WiFi avec AirMagnet PlannerSyNAP Services
 

Viewers also liked (20)

3 instrumen pbppp
3 instrumen pbppp3 instrumen pbppp
3 instrumen pbppp
 
Atelier 4 l'expérience de la colo 3 g - clément bouhelier
Atelier 4   l'expérience de la colo 3 g - clément bouhelierAtelier 4   l'expérience de la colo 3 g - clément bouhelier
Atelier 4 l'expérience de la colo 3 g - clément bouhelier
 
Behaviorism and education prezentacja webquest
Behaviorism and education prezentacja webquestBehaviorism and education prezentacja webquest
Behaviorism and education prezentacja webquest
 
082-JLS-S3-083-ATENA-PROMOTIONS
082-JLS-S3-083-ATENA-PROMOTIONS082-JLS-S3-083-ATENA-PROMOTIONS
082-JLS-S3-083-ATENA-PROMOTIONS
 
SIEGMA SERVICES
SIEGMA SERVICES SIEGMA SERVICES
SIEGMA SERVICES
 
Doc
DocDoc
Doc
 
Bab 6
Bab 6Bab 6
Bab 6
 
Croquis presentation internet
Croquis presentation internetCroquis presentation internet
Croquis presentation internet
 
Resume - Perkins James.docx-2014
Resume - Perkins James.docx-2014Resume - Perkins James.docx-2014
Resume - Perkins James.docx-2014
 
Brochure
BrochureBrochure
Brochure
 
Finance
FinanceFinance
Finance
 
Referanslar
ReferanslarReferanslar
Referanslar
 
Franceagrimer rapport d'activite année 2014
Franceagrimer rapport d'activite année 2014Franceagrimer rapport d'activite année 2014
Franceagrimer rapport d'activite année 2014
 
10 Quick-Tips for VIENNA
10 Quick-Tips for VIENNA10 Quick-Tips for VIENNA
10 Quick-Tips for VIENNA
 
Imentra conseil - Offre IMMO-PLANNER
Imentra conseil - Offre IMMO-PLANNERImentra conseil - Offre IMMO-PLANNER
Imentra conseil - Offre IMMO-PLANNER
 
15 conseils efficaces_pour_rendre_votre_site_internet_plus_agreable
15 conseils efficaces_pour_rendre_votre_site_internet_plus_agreable15 conseils efficaces_pour_rendre_votre_site_internet_plus_agreable
15 conseils efficaces_pour_rendre_votre_site_internet_plus_agreable
 
Life and Work of Salim Ali
Life and Work of Salim AliLife and Work of Salim Ali
Life and Work of Salim Ali
 
Behaviorism and education
Behaviorism and education Behaviorism and education
Behaviorism and education
 
Bien réussir votre étude de couverture WiFi
Bien réussir votre étude de couverture WiFiBien réussir votre étude de couverture WiFi
Bien réussir votre étude de couverture WiFi
 
Conception de Réseau WiFi avec AirMagnet Planner
Conception de Réseau WiFi avec AirMagnet PlannerConception de Réseau WiFi avec AirMagnet Planner
Conception de Réseau WiFi avec AirMagnet Planner
 

Similar to Oops

Core java interview questions1
Core java interview questions1Core java interview questions1
Core java interview questions1Lahari Reddy
 
Java Core Parctical
Java Core ParcticalJava Core Parctical
Java Core ParcticalGaurav Mehta
 
Java J2EE Interview Questions Part-1
Java J2EE Interview Questions Part-1Java J2EE Interview Questions Part-1
Java J2EE Interview Questions Part-1javatrainingonline
 
Review oop and ood
Review oop and oodReview oop and ood
Review oop and oodthan sare
 
1669617800196.pdf
1669617800196.pdf1669617800196.pdf
1669617800196.pdfvenud11
 
Java interview questions and answers
Java interview questions and answersJava interview questions and answers
Java interview questions and answersMadhavendra Dutt
 
Core java interview faq
Core java interview faqCore java interview faq
Core java interview faqKumaran K
 
Java interview faq's
Java interview faq'sJava interview faq's
Java interview faq'sDeepak Raj
 
Collection framework (completenotes) zeeshan
Collection framework (completenotes) zeeshanCollection framework (completenotes) zeeshan
Collection framework (completenotes) zeeshanZeeshan Khan
 
Java/J2EE interview Qestions
Java/J2EE interview QestionsJava/J2EE interview Qestions
Java/J2EE interview QestionsArun Vasanth
 
oops-123991513147-phpapp02.pdf
oops-123991513147-phpapp02.pdfoops-123991513147-phpapp02.pdf
oops-123991513147-phpapp02.pdfArpitaJana28
 
116824015 java-j2 ee
116824015 java-j2 ee116824015 java-j2 ee
116824015 java-j2 eehomeworkping9
 

Similar to Oops (20)

Core java interview questions1
Core java interview questions1Core java interview questions1
Core java interview questions1
 
Java Core Parctical
Java Core ParcticalJava Core Parctical
Java Core Parctical
 
Java J2EE Interview Questions Part-1
Java J2EE Interview Questions Part-1Java J2EE Interview Questions Part-1
Java J2EE Interview Questions Part-1
 
Java J2EE Interview Questions Part-1
Java J2EE Interview Questions Part-1Java J2EE Interview Questions Part-1
Java J2EE Interview Questions Part-1
 
Java interview questions
Java interview questionsJava interview questions
Java interview questions
 
C# interview
C# interviewC# interview
C# interview
 
Review oop and ood
Review oop and oodReview oop and ood
Review oop and ood
 
Oops
OopsOops
Oops
 
Delphi qa
Delphi qaDelphi qa
Delphi qa
 
Java basics
Java basicsJava basics
Java basics
 
1669617800196.pdf
1669617800196.pdf1669617800196.pdf
1669617800196.pdf
 
Java interview questions
Java interview questionsJava interview questions
Java interview questions
 
Java interview questions and answers
Java interview questions and answersJava interview questions and answers
Java interview questions and answers
 
Core java interview faq
Core java interview faqCore java interview faq
Core java interview faq
 
Java interview faq's
Java interview faq'sJava interview faq's
Java interview faq's
 
Collection framework (completenotes) zeeshan
Collection framework (completenotes) zeeshanCollection framework (completenotes) zeeshan
Collection framework (completenotes) zeeshan
 
Java/J2EE interview Qestions
Java/J2EE interview QestionsJava/J2EE interview Qestions
Java/J2EE interview Qestions
 
oops-123991513147-phpapp02.pdf
oops-123991513147-phpapp02.pdfoops-123991513147-phpapp02.pdf
oops-123991513147-phpapp02.pdf
 
116824015 java-j2 ee
116824015 java-j2 ee116824015 java-j2 ee
116824015 java-j2 ee
 
Java mcq
Java mcqJava mcq
Java mcq
 

Recently uploaded

Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 

Recently uploaded (20)

Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 

Oops

  • 1. What is Polymorphism? The Polymorphism can be referred as one name many forms. It is the ability of methods to behave differently, depending upon the object who is calling it. The key features of Polymorphism are: Allows using one interface for multiple implementations. Supports Method Overloading: Multiple methods with same name, but different formal argument. Supports Method Overridden: Multiple methods have the same name, same return type, and same formal argument list. Explain garbage collection. The Java uses the garbage collection to free the memory. By cleaning those objects that is no longer reference by any of the program. Step involve in cleaning up the garbage collection: Garbage Object Collection: first step is to collection and group all those object which are no more reference with any of the program. We can use the different methods to collect the garbage object like using runtime.gc() or system.gc(). Run Finalize method: To free up those object which is collected by the garbage collector java must execute the Finalize method to delete all those dynamically created object What is an immutable object? An immutable object is one that we cannot change once it is created. Steps involved in creation of an immutable object are: Make all of its data fields private. Methods which can perform changes in any of the data fields after the construction of object must be avoided. How are this() and super() used with constructors? this() Constructors: is used to pointing the current class instance.
  • 2. Can be used with variables or methods. Used to call constructer of same class. Private variable cannot be accessed using this(). super() Constructer: is used to call constructor of parent class. Must be the first statement in the body of constructor. Using this we can access private variables in the super class. What are Access Specifiers available in Java? Java offers four access specifiers, described below: Public: public classes, methods, and fields can be accessed by every class. Protected: protected methods and fields can only be accessed within the same class to which the methods and fields belong. Default (no specifier): when we do not set access to specific level, then such a class, method, or field will be accessible from inside the same package to which the class, method, or field belongs. Private: private methods and fields can only be accessed within the same class to which the methods and fields belong. Private methods and fields are not inherited by subclasses. What is Constructor? A constructor is used to initialize a newly created object. It is called just after the memory is allocated for the object. It can be used to initialize the objects. It is not mandatory to write a constructor for the class. Name of constructor is same as the class name. Cannot be inherited. Constructor is invoked whenever an object of its associated class is created. What are the List interface and its main implementation?
  • 3. The List helps in collections of objects. Lists may contain duplicate elements. The main implementations of the List interface are as follows: ArrayList: Resizable-array implementation of the List interface. Vector: Synchronized resizable-array implementation of the List. LinkedList: Doubly-linked list implementation of the List interface. Better performance than the ArrayList implementation when elements are inserted or deleted timely. Explain the user defined Exceptions. User Defined Exceptions are exceptions defined by the user for specific purposed. This allows custom exceptions to be generated and caught in the same way as normal exceptions. While defining a User Defined Exception, we need to take care of the following aspects: It should be extend from Exception class. Use toString() method to display information about the exception. Describe life cycle of thread. Threads follow the single flow of control. A thread is execution in a program. The life cycles of threads are listed below: Newborn state: After the creations of Thread instance the thread is in this state but before the start() method invocation. Thread is considered not alive in this phase. Runnable state: A thread starts its life from Runnable state. After the invoking of start() method thread enters Runnable state. Running state: A thread first enters Runnable state. Blocked state: A thread can enter in this state because of waiting the resources that are hold by another thread. Dead state: A thread can be considered dead when its run() method completes. If any thread comes on this state that means it cannot ever run again. What is an Applets?
  • 4. Applets: These are small java programs. They can send from one computer to another computer over the internet using the Applet Viewer that supports java. Applets can runs in a Web browser as it is a java program. It can be a fully functional Java application because it has the entire Java API at its disposal. Applets follow the security rules given by the Web browser. Applet security is also known as sandbox security. What is the Set interface? A Set interface is collection of element which cannot be duplicated. The Set interface contains methods inherited from collection. It provides methods to access the elements of a finite mathematical set. Two Set objects are equal if they contain the same elements. It models the mathematical set abstraction. What is a HashSet and TreeSet? The HashSet is an unsorted, unordered Set. It is Collection set that restrict duplicate elements and also repositioning of elements. It implements the Set interface and extends AbstractSet. Uses hash code of the object being inserted. The TreeSet is a Set implemented when we want elements in a sorted order. Sorting of element is done according to the natural order of elements or by the help of comparator provided at creation time. How do you decide when to use HashMap and when to use TreeMap and what is difference between these two?
  • 5. HashMap is used when we want to perform insertion, deletion, and locate elements in a Map. TreeMap is used when we want to traverse the elements in a sorted order. Depending upon the size of collection, adding elements to HashMap is easy. For sorted elements traversal we can convert the HashMAp into TreeMap. HashMap: Lets us to have null values and also one null key Iterator in the HashMap is Fail-Safe. It is Unsynchronized. HashTable: It does not allow null value as key and value. It is not synchronized. What is the Comparable interface? The Comparable interface is used to sort collections and arrays of objects using the collections.sort() and java.utils. The objects of the class implementing the Comparable interface can be ordered. All classes implementing the Comparable interface must implement the compareTo() method that has the return type as an integer. The signature of the compareTo() method is as follows: int i = object1.compareTo(object2) If object1 < object2: The value of i returned will be negative. If object1 > object2: The value of i returned will be positive. If object1 = object2: The value of i returned will be zero. When should I use abstract classes and when should I use interfaces?
  • 6. Use Interface, when: Design changing frequently or when various implementations only share method signatures. We need some classes to use some methods which we do not want to be included in the class. Use Abstract Class, when: Various implementations are of the same kind and use common behavior. Enabling with generalized form of abstraction and leave the implementation task with the inheriting subclass. creating planned inheritance hierarchies Explain the Polymorphism principle. The Polymorphism can be referred as one name many forms. It is the ability of methods to behave differently, depending upon the object who is calling it. Polymorphism exists in three distinct forms in Java: Method overloading Method overriding through inheritance Method overriding through the Java interface What are the difference between throw and throws? The differences are between throw and throws are: Throw is used to trigger an exception where as throws is used in declaration of exception. Without throws, Checked exception cannot be handled where as checked exception can be propagated with throws. Throw is used inside the method where as throws is used with the method signature. Throw is followed by an instance but throws is followed by class.
  • 7. What is difference between preemptive scheduling and time slicing? Differences between preemptive and time scheduling are: In Preemptive scheduling the highest priority task executes until it enters the waiting or dead stated or a higher priority task comes into existence. Time slicing, a task executes for a predefined time period and then the pool of ready tasks. The scheduler then determines which task should execute next, based on priority and other factor. Explain traversing through a collector using Iterator. Ans. We can access each element in the Collection by using Iterators irrespective of how they are organized in the collector. Iterator can be implemented a different way for every Collection. To use an iterator to traverse through the contents of a collection we do: Obtain an iterator by calling the collections iterator()method to the start of the collection. Set up a loop that makes a call to hasNext(). Have the loop iterate as long as hasNext()returns true. Within the loop, obtain each element by calling next(). remove() method is used to remove the current element in the iteration. What are the principle concepts of OOPS? There are four principle concepts upon which object oriented design and programming rest. They are: Abstraction: Abstraction refers to the act of representing essential features without including the background details or explanations. Polymorphism: is the ability to create a variable, a function, or an object that has more than one form. Inheritance: Inheritance is the process by which objects of one class acquire the properties of objects of another class.
  • 8. Encapsulation: Encapsulation is a technique used for hiding the properties and behaviors of an object and allowing outside access only as appropriate. It prevents other objects from directly altering or accessing the properties or methods of the encapsulated object. What are the basic features of java? The basic features of Java are given below : • Java is simple. • Java provides immense security. • Java provides high portability. • Java provides object oriented programming features • Java provides robustness. • Java is multuthreaded. • Java provides architecture neutrality. • Java is distributed • Java is dynamic. How java becomes object oriented? • Java follows the paradigm of OO programming. • Java follows modular approach. • Java follows the abstraction aspect. • Java follows the OO principle encapsultaion. • Java follows the OO principle polymorphism. • Java follows the OO principle inheritance. How java becomes robust? • Java provides multi-platformed environment.
  • 9. • Java provides high reliability in the design. • Java is a strictly typed language. • Java checks the code at runtime. • Java provides predictablity. • java provides various keywords. How a Java program compiles? • First the source file name must be extended with .java extension. e.g. Myprog.java • Execute the javac compiler. • javac compiler creates a file called Myprog.class i.e. the bytecode version of Myprog.java. • The butecode is executed by the Java runtime-systems which is called Java Virtual Machine (JVM). • JVM is platform dependent. What is 'public static void main ( String args[ ] ) ' signifies? • the access specifier is the 'public' keyword . • 'static' keyword allows main() to be called without instantiating a particular instance of a class. • 'void' affirns the compiler that no value is returned by main(). • 'main()' mathod is called at the beginning of a Java program. • 'String args()' tells a parameter named args,which is an instance array of class String What 'System.out.println()' signifies? • 'System' is a predefined class . • System class givesacces to the system. • 'out' is the output stream.
  • 10. • 'println' is printing the line on the console. • This is a console output statement. What is a variable in Java program? • It's a memory location. • The memory location is given some name. • The memory location is being assigned some value. • The value may change of the variable. • The memory location size changes with the type of the variable. What is JVM? • JVM is the acronym stands for 'Java virtual machine'. • JVM provides the execution environment. • JVM is not platform independent.. • JVM is the Java run-time system. • JVM is an interpreter of bytecode. • JVM also makes the sytem secured. What is bytecode? • Bytecode is an instruction set. • Bytecode extends wiith .class. • 'javac' compiler translates the .java file into .class. • JVM interpretes bytecode. • Bytecode facility makes Java platform-independent.
  • 11. • It also confirms security tothe Java code. What is Java applet? • Applet is a java program. • It has been designed for transmitting the Java code over the internet. • It is automatically executed by Java-enabled Web Browser. • Applet can repnse to the user input.