• Study Materials
    • InfyTQ Archive
    • Infosys Archive
    • TCS Archive
    • Accenture Archive
    • AMCAT Archive
    • Capgemini Archive
    • Cisco Archive
    • CoCubes Archive
    • Cognizant(CTS) Archive
    • Deloitte Archive
    • DXC Archive
    • Goldman Sachs Archive
    • Hexaware Technologies Archive
    • LTI Archive
    • MindTree Archive
    • Virtusa Archive
    • Wipro Archive
  • Interview Preparation
    • C Interview Questions
    • Data Structures Interview Questions
    • DBMS Interview Questions
    • HR Interview Questions
    • Java Interview Questions
    • Operating System Interview Questions
    • Python Interview Questions
    • SQL Query Interview Questions
  • Tutorials
    • Node.js Tutorial
    • Express.js Tutorial
    • Python Tutorial
  • Programming
    • C Programming MCQs
    • C Code Snippets – Output Questions
    • Python Code Snippets – Output Questions
    • Java Code Snippets – Output Questions
  • Aptitude
    • Verbal Ability for Placements
CODE OF GEEKS

We at CODE OF GEEKS, aim at providing best and quality content for our users at no extra cost.

    • Study Materials
      • InfyTQ Archive
      • Infosys Archive
      • TCS Archive
      • Accenture Archive
      • AMCAT Archive
      • Capgemini Archive
      • Cisco Archive
      • CoCubes Archive
      • Cognizant(CTS) Archive
      • Deloitte Archive
      • DXC Archive
      • Goldman Sachs Archive
      • Hexaware Technologies Archive
      • LTI Archive
      • MindTree Archive
      • Virtusa Archive
      • Wipro Archive
    • Interview Preparation
      • C Interview Questions
      • Data Structures Interview Questions
      • DBMS Interview Questions
      • HR Interview Questions
      • Java Interview Questions
      • Operating System Interview Questions
      • Python Interview Questions
      • SQL Query Interview Questions
    • Tutorials
      • Node.js Tutorial
      • Express.js Tutorial
      • Python Tutorial
    • Programming
      • C Programming MCQs
      • C Code Snippets – Output Questions
      • Python Code Snippets – Output Questions
      • Java Code Snippets – Output Questions
    • Aptitude
      • Verbal Ability for Placements
CODE OF GEEKS
CODE OF GEEKS
  • Study Materials
    • InfyTQ Archive
    • Infosys Archive
    • TCS Archive
    • Accenture Archive
    • AMCAT Archive
    • Capgemini Archive
    • Cisco Archive
    • CoCubes Archive
    • Cognizant(CTS) Archive
    • Deloitte Archive
    • DXC Archive
    • Goldman Sachs Archive
    • Hexaware Technologies Archive
    • LTI Archive
    • MindTree Archive
    • Virtusa Archive
    • Wipro Archive
  • Interview Preparation
    • C Interview Questions
    • Data Structures Interview Questions
    • DBMS Interview Questions
    • HR Interview Questions
    • Java Interview Questions
    • Operating System Interview Questions
    • Python Interview Questions
    • SQL Query Interview Questions
  • Tutorials
    • Node.js Tutorial
    • Express.js Tutorial
    • Python Tutorial
  • Programming
    • C Programming MCQs
    • C Code Snippets – Output Questions
    • Python Code Snippets – Output Questions
    • Java Code Snippets – Output Questions
  • Aptitude
    • Verbal Ability for Placements

InfyTQ Previous Year Java Questions 2022

  • December 23, 2021
  • CODE OF GEEKS
  • 0

InfyTQ Previous Year Java Questions

Q. Consider the given code below :

import java.time.LocalDate;
class employee { 
    private String name; 
    employee(String name) {
    this.Name = name;
    }
    boolean validateDetails(){
        for(int index=0; index<this.Name.length();index++)
        { 
         if((this.Name.charAt(index) >= 'A' && this.Name.charAt(index) <= 'Z') 
            ||(this.Name.charAt(index) >= 'a' && this.Name.charAt(index) <= 'z')){}
         else{
             return false;
         }
         return true;
        }
    }

Find the programming violations in this code :

i. Unused import statements
ii. Empty if
iii. class name and variable naming conventions
iv. Usage of default access modifiers

Choose the correct option :

a. i, ii, iii
b. i, iv
c. iii only
d. i, iii

View Answer

Ans. c



Q. Consider the below code that results in a compilation error :

abstract class Parent {
    Parent(){
        System.out.println("Parent Class");
    }
    abstract void display();
}
public class Child extends Parent {
    Child() {
        System.out.println("Child Class");
    }
    public static void main(String[] args)
    {
        Parent parent = new Child();
    }
}

Identify TWO ways from the given options which can be used to rectify the compilation error.

a. Make the Child class abstract and remove the child object created in main method.
b. Make the reference and object of same type in the main method.
c. Inherit method display() in Child
d. Remove the constructor in Parent class

View Answer

Ans. a, d



Q. An Employee Management System application is used to maintain information about employees in an organization. In the application, employee details are stored in ascending order of the employee ids. Which algorithmic design technique would best fit if an employee needs to be searched based on the ids.

a. Greedy Approach
b. Brute Force
c. Divide & Conquer
d. Dynamic Programming

View Answer

Ans. c

Q. Consider the below code that results in a compilation error :

abstract class Parent {
    Parent(){
        System.out.println("Parent Class");
    }
    abstract void display();
}
public class Child extends Parent {
    Child() {
        System.out.println("Child Class");
    }
    public static void main(String[] args)
    {
        Parent parent = new Child();
    }
}

Identify TWO ways from the given options which can be used to rectify the compilation error.

a. Make the Child class abstract and remove the child object created in main method.
b. Make the reference and object of same type in the main method.
c. Inherit method display() in Child
d. Remove the constructor in Parent class

View Answer

Ans. a, d



Pages: 1 2 3 4 5 6
Tags: how many attempts for infytqhow much java needed for seleniumhow much java required for seleniuminfytq coding questions and answersinfytq exam coding questionsinfytq hands on coding questionsinfytq interview questionsinfytq java coding questionsinfytq java coding questions 2022infytq java coding questions and answersinfytq java coding questions with answersinfytq java hands on coding questionsinfytq java mcq questionsinfytq java mcq questions and answersinfytq java programming questionsinfytq java questionsinfytq java syllabusinfytq previous year java questionsinfytq previous year questions javainfytq processinfytq questions and answers java qualifying roundinfytq questions javajava infytq mcqjava infytq questionsjava mcq questions for infytqjava mcqs for infytqjava questions for infytqwhat is infytq examwho introduced javawhy java interview questions
  • Previous Python Programming Mock Test Series
  • Next InfyTQ Certification Exam 2022-2023 | Eligibility Criteria | Helpful Study Materials

Leave a Reply Cancel reply

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

Learning Python

python tutorials

InfyTQ Previous Year Questions 2023

  • InfyTQ 2023 Overview
  • InfyTQ Previous Year Coding Questions
  • InfyTQ Previous Year Python Questions
  • InfyTQ Previous Year Java Questions
  • InfyTQ Previous Year DBMS Questions
  • 100+ Python MCQs for InfyTQ
  • Java MCQs for InfyTQ

Study Materials : Company Wise

CODE OF GEEKS

Subscribe to Newsletter

CODE OF GEEKS

Learn | Code | Achieve

Reach us

[email protected]
We at CODE OF GEEKS, aim at providing quality content to our users at no cost.
CODE OF GEEKS

Important Pages

About us
Advertise
Privacy Policy
Terms and Conditions
Refund Policy
Contact us

Placements – Study Materials

TCS NQT     Wipro     CapGemini
Accenture     MindTree     CTS
DXC     Hexaware Technologies     AMCAT
CoCubes     Goldman Sachs     Dell
Cisco     Deloitte     Virtusa     LTI     Infosys   

Tutorials

Python
Node.js
Express.js
Golang

Recent Posts

Strings in Go and its basic operations
  • August 11, 2023
Introduction to Functions in Go programming
  • August 11, 2023

Copyright @ CODE OF GEEKS. All Rights Reserved.