What is static?

Technical
Easy
Infosys
92.5K views

Direct Answer

Tests understanding of the static keyword in programming languages like Java or C++.

Why Interviewers Ask This

The static keyword is frequently used in programming. Interviewers ask this to check if the candidate understands class-level variables and methods versus instance-level ones. It is a common topic in coding interviews.

How to Answer This Question

Explain that static members belong to the class rather than any specific instance. Mention that they are shared across all instances and exist even if no objects are created. Discuss common uses like utility methods or constants. Clarify memory allocation differences.

Key Points to Cover

  • Class-level membership
  • Shared across instances
  • Memory allocation
  • Common use cases

Sample Answer

In programming, the static keyword indicates that a member variable or method belongs to the class itself, not to any specific instance. Static members are shared among all objects of the class and are initialized when t…

Common Mistakes to Avoid

  • Confusing with final keyword
  • Thinking static means constant
  • Ignoring initialization timing

Sound confident on this question in 5 minutes

Answer once and get a 30-second AI critique of your structure, content, and delivery. First attempt is free — no signup needed.

Try it free

Related Interview Questions

Browse all 180 Technical questionsBrowse all 149 Infosys questions