Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 3 out of 19 pages
Exam (elaborations)

Revature Interview UPDATED Exam Questions and CORRECT Answers

Document preview thumbnail
Preview 3 out of 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

Content preview

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;
}
...
}

Document information

Uploaded on
March 26, 2025
Number of pages
19
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
£8.86

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
STANFORDGENIUS
4.0
(238)
Sold
1577
Followers
108
Items
114411
Last sold
8 hours ago




Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these revision notes.

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and smashed it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions