Add office photos
Engaged Employer

Cyber Infrastructure

3.6
based on 244 Reviews
Filter interviews by

Interview Questions and Answers

Updated 4 May 2024

Q1. What is class what is object what is different between private protected and public and default

Ans.

A class is a blueprint for creating objects, while an object is an instance of a class. Private, protected, public, and default are access modifiers in object-oriented programming.

  • A class is a template or blueprint that defines the properties and behaviors of objects.

  • An object is an instance of a class, created using the class blueprint.

  • Private access modifier restricts access to class members within the same class.

  • Protected access modifier allows access within the same class...read more

View 1 answer

Q2. What is object ?

Ans.

An object is a self-contained entity that consists of both data and behavior.

  • Objects are instances of classes in object-oriented programming.

  • They encapsulate data and provide methods to manipulate that data.

  • Objects can interact with each other through method calls and message passing.

  • Examples of objects include a car, a person, or a bank account.

View 1 answer

Q3. What is public?

Ans.

Public is a keyword in programming languages that denotes the accessibility of a class, method, or variable.

  • Public is one of the access modifiers in object-oriented programming.

  • It allows the class, method, or variable to be accessed from any other class or package.

  • Public members are part of the public API of a software component.

  • Example: public class MyClass { ... }

  • Example: public void myMethod() { ... }

  • Example: public int myVariable = 10;

View 1 answer

Q4. What is private?

Ans.

In programming, private is an access modifier that restricts the visibility of a class member to within its own class.

  • Private is used to encapsulate data and prevent direct access from outside the class.

  • Private members can only be accessed through public methods or properties.

  • Private variables are often used to store internal state or implementation details.

  • Private methods are used for internal logic and are not meant to be called from outside the class.

View 1 answer
Discover null interview dos and don'ts from real experiences

Q5. What is protected

Ans.

protected is an access modifier in object-oriented programming that restricts access to members within the same package or subclasses.

  • protected is one of the four access modifiers in Java, along with public, private, and default.

  • Members declared as protected can be accessed within the same package or by subclasses.

  • Protected members are not accessible outside the package unless accessed through inheritance.

  • Example: protected int age; can be accessed by any subclass of the clas...read more

Add your answer

Q6. Difference between == and ===

Ans.

The == operator checks for equality, while the === operator checks for strict equality (including data type).

  • The == operator only checks for equality of values, not data types.

  • The === operator checks for both equality of values and data types.

  • Example: 5 == '5' would return true, but 5 === '5' would return false.

Add your answer
Contribute & help others!
Write a review
Share interview
Contribute salary
Add office photos

Interview Process at null

based on 3 interviews in the last 1 year
Interview experience
4.0
Good
View more
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Software Developer Interview Questions from Similar Companies

4.3
 • 55 Interview Questions
3.5
 • 26 Interview Questions
3.7
 • 25 Interview Questions
3.4
 • 19 Interview Questions
4.3
 • 15 Interview Questions
3.4
 • 10 Interview Questions
View all
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
70 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions
Get AmbitionBox app

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter