Accenture Confirming Interview Questions Glassdoor

Accenture Technical Interview Questions: Freshers and Experienced

  • The static keyword is a non-access modifier in Java that is useful for memory management.
  • Static property can be shared by all the objects, no separate copies of static members will be created on object creation.
  • No need to create the instance of the class for accessing static members, we can directly access them by using the class name.
  • The static keyword can be used with the variable, block, method, and nested classes for memory management.
    • Static variable: When a variable is declared with the static keyword, a single copy of the variable will be created and the same variable will be shared across all objects of the class (a class to which the static variable belongs).
    • Static block: A static block helps with the initialization of the static data members. It is a group of statements within a Java class and gets executed exactly once when the class is first loaded into the JVM(Java Virtual Machine).
    • Static method: If the method is declared with the static keyword, then it is considered a static method. The main( ) method is one of the examples of a static method. Static methods are having restrictions such as they can directly call other static methods only, and they can access static data directly.
    • Static class: Only a nested class can be created as a static class. Nested static class doesn’t need a reference of Outer class(a class in which the nested class is defined). A static class does not have permission to access non-static members of the Outer class.
  • What are lambda expressions in Java?

  • A Lambda expression is a function that can be created without including it in any class. It was introduced in Java 8.
  • It is used to provide the interface implementation which has a functional interface. It does not require defining the method again for providing the implementation, it is allowed to just write the implementation code. Thus it saves plenty of coding.
  • Lambda expression is considered as a function, the .class file will not be created by the compiler.
  • They are generally used for simple callbacks or event listeners implementation, or in functional programming with the Java Streams API.
  • Lambda Expression Syntax is:(argument_list) -> {body} Three components of Lamda expression are:
    1. argument_list: Zero or more number of arguments.
    2. -> (arrow-token): Used to link argument_list and body of lambda expression.
    3. body: Contains statements and expressions for lambda expression.
  • A Java example program to illustrate lambda expressions by implementing the user-defined functional interface is given below:
  • In the above example program, Example Interface is the functional interface that has a single abstract method abstractPrint(). By using lambda expression within InterviewBit class, we are implementing the functional interface by providing implementation code for the abstract method within an interface.

    1 What is the difference between dictionary and tuple in Python?

    Dictionary Tuple
    A dictionary is an unordered data collection in which data will be stored in the form of key-value pairs. A tuple is an ordered data collection.
    Elements are accessed using key values. Elements are accessed using numeric index values.
    Dictionary can have any number of values. A tuple can have only a pre-defined number of values.
    It is used as a model object. It is useful for returning multiple values from a function.

    How to prepare for job interview with glassdoor

    Related Posts

    Leave a Reply

    Your email address will not be published. Required fields are marked *