Rédigé par des étudiants ayant réussi Disponible immédiatement après paiement Lire en ligne ou en PDF Mauvais document ? Échangez-le gratuitement 4,6 TrustPilot
logo-home
Document preview thumbnail
Aperçu 3 sur 19 pages
Examen

Revature Interview UPDATED Exam Questions and CORRECT Answers

Document preview thumbnail
Aperçu 3 sur 19 pages

Revature Interview UPDATED Exam Questions and CORRECT Answers What is a getter/setter? What is their purpose? - CORRECT ANSWER modify private variables. How do you select all tables in a database? - CORRECT ANSWER sys.Tables or SELECT*FROMinformation_s How do you link a style sheet to an html document? - CORRECT ANSWER the link element link rel="stylesheet" type="text/css" href="css/" Can we overload or override static methods in java? - CORRECT ANSWER - Functions that - SELECT* FROM - By u

Aperçu du contenu

Revature Interview UPDATED Exam
Questions and CORRECT Answers
Define Object-Oriented Programming. - CORRECT ANSWER - the ability to design a
program using classes and objects


What is an Object? - CORRECT ANSWER - an instance of a class. Each object contains
an address and takes up some space in memory.


How do Objects communicate? - CORRECT ANSWER - Objects can communicate
without knowing the details of each other's data or code. The type of message accepted and type
of response returned by the objects are the only necessary elements.


Give an example of an Object? - CORRECT ANSWER - A dog has
states: color, name, breed, etc.
and behaviors: tail wagging, barking, eating, etc.


public class Dog {
String breed;
int age;
String color;
void barking() {
}
void hungry() {
}
void sleeping() {
}
}

,Define a class. - CORRECT ANSWER - A class is a template that is used to create objects
and define object types and methods.
Classes can be defined as the blueprint from which you can create an individual object.


What are the core properties of a class? - CORRECT ANSWER - The data types and
methods that may be used by that object. Classes do not consume any space.


What are advantages of OOPs over Procedure Oriented Programming? - CORRECT
ANSWER - - OOPs makes development and maintenance easier than Procedure-Oriented
languages, especially as the project size increases.
- OOPs provides data hiding (abstraction), but in Procedure-Oriented languages, global data can
be accessed from anywhere.


Define a constructor. - CORRECT ANSWER - A constructor is a block of codes similar to
the method.
Basically, it is a special type of method which is used to initialize the object.


When is a constructor called? - CORRECT ANSWER - It is called when an instance of the
object is created, and memory is allocated for the object.
At object creation, the compiler calls constructors for all of its subobjects (its members and
inherited objects).


When are parameterized constructors called/not called? - CORRECT ANSWER - If
members have default constructors without parameters, those constructors are called
automatically, otherwise parameterized constructors are called using an initializer list.


Why is it called 'constructor'? - CORRECT ANSWER - Because it constructs the values at
the time of object creation


Is it necessary to write a constructor for a class? - CORRECT ANSWER - It is not,
because Java compiler creates a default constructor if your class doesn't have any.

, Rules to remember while creating a contructor - CORRECT ANSWER - Three rules:
- Constructor name must be the same as the class name
- Constructor must not have an explicit return type
- Java constructors cannot be abstract, static, final, or synchronized


What are the two types of constructors? Define each. - CORRECT ANSWER - - Default: a
no-args constructor that Java compiler inserts on your behalf
- Parameterized: has a specific number of parameters


Define the components of default constructors. - CORRECT ANSWER - they contain a
default call to super(), which is the default behavior.
Ex.
class Bike {
Bike() { }
...
}


Why are parameterized constructors used? - CORRECT ANSWER - used to provide
different values to the distinct objects in addition to the default values.


Ex.
class Student {
Student(int i, String n) {
id = i;
name = n;
}
...
}

Infos sur le Document

Publié le
26 mars 2025
Nombre de pages
19
Écrit en
2024/2025
Type
Examen
Contenu
Questions et réponses
$11.49

Mauvais document ? Échangez-le gratuitement Dans les 14 jours suivant votre achat et avant le téléchargement, vous pouvez choisir un autre document. Vous pouvez simplement dépenser le montant à nouveau.
Rédigé par des étudiants ayant réussi
Disponible immédiatement après paiement
Lire en ligne ou en PDF

Seller avatar
Les scores de réputation sont basés sur le nombre de documents qu'un vendeur a vendus contre paiement ainsi que sur les avis qu'il a reçu pour ces documents. Il y a trois niveaux: Bronze, Argent et Or. Plus la réputation est bonne, plus vous pouvez faire confiance sur la qualité du travail des vendeurs.
STANFORDGENIUS
4.0
(238)
Vendu
1577
Abonnés
108
Éléments
114411
Dernière vente
9 heures de cela




Pourquoi les étudiants choisissent Stuvia

Créé par d'autres étudiants, vérifié par les avis

Une qualité sur laquelle compter : rédigé par des étudiants qui ont réussi et évalué par d'autres qui ont utilisé ce document.

Le document ne convient pas ? Choisis un autre document

Aucun souci ! Tu peux sélectionner directement un autre document qui correspond mieux à ce que tu cherches.

Paye comme tu veux, apprends aussitôt

Aucun abonnement, aucun engagement. Paye selon tes habitudes par carte de crédit et télécharge ton document PDF instantanément.

Student with book image

“Acheté, téléchargé et réussi. C'est aussi simple que ça.”

Alisha Student

Vous travaillez sur vos références ?

Créez des citations précises en APA, MLA et Harvard avec notre générateur de sources gratuit.

Vous travaillez sur vos références ?

Foire aux questions