.
  Vyom World.com . Let's Touch the Sky Together!  
.

Home
VyomWorld.com Home
Interview Questions
VyomLinks.com Home
JobsAssist.com Home
Vyom Network
Contact Us
Jobs & Careers
Resume Submitter
Placement Papers
IT Companies Directory
Computer Jobs
Interview Questions
Online Exams
Vyom Career eMag.
Fun
Send FREE SMS!
SMS Jokes
Source Codes Library
Source Codes Home
ASP Source Codes
C Source Codes
C++ Source Codes
COBOL Source Codes
Java Source Codes
Pascal Source Codes
Submit Source Codes
GATE
GATE an Overview
GATE Preparation
Study Materal
GRE
GRE an Overview
GRE Questions
GRE Preparation
GRE Universities
TOEFL Preparation
TOEFL Resources
GMAT Preparation
GMAT Resources
MBA Preparation
MBA Resources
Networking Concepts
Networking Concepts
Testing Preparation
Testing Resources
Webmasters
Free Traffic Builder
Webmaster Articles
Web Hosting
Tutorials
Hardware Tutorial
1500 Free eBooks New!


Home » Placement Papers » Mphasis Placement Papers » Mphasis Previous Year Placement Paper

 

Mphasis Placement Paper -: Java Questions With Answers


Advertisements
Advertisements




Mphasis Previous Years Solved Sample Placement Papers

  1. What is the key difference between a while loop and a do-while loop in Java?

    A: The syntax used to define the loop

    B: The number of iterations performed

    C: The condition check timing

    D: The ability to use the break statement

    Ans: C
  2. Which loop construct guarantees that the loop body is executed at least once?

    A: for loop

    B: while loop

    C: do-while loop

    D: continue statement

    Ans: C
  3. What is an infinite loop?

    A: A loop that executes only once

    B: A loop that never terminates naturally

    C: A loop that contains an unreachable code block

    D: A loop that uses the continue statement

    Ans: B
  4. Which statement is used to exit a loop prematurely?

    A: return statement

    B: continue statement

    C: break statement

    D: exit statement

    Ans: C
  5. Which loop construct is best suited for iterating over an array or a collection?

    A: for loop

    B: while loop

    C: do-while loop

    D: continue statement

    Ans: A
  6. How do you declare an array in Java?

    A: int arrayName;

    B: int[] arrayName;

    C: int arrayName[];

    D: Both b and c

    Ans: D
  7. Which method is used to get the length of an array in Java?

    A: length()

    B: size()

    C: getLength()

    D: length

    Ans: D
  8. How do you initialize an array in Java?

    A: int[] arr = (1,2,3,4,5);

    B: int arr = {1,2,3,4,5};

    C: int[] arr = new int[]{1,2,3,4,5};

    D: int arr = new int(5);

    Ans: C
  9. What happens when you try to access an array element with an index that is out of bounds?

    A: It returns -1

    B: It returns a null value

    C: It throws an exception

    D: It initializes a new array

    Ans: C
  10. How can you check if two arrays are equal in Java?

    A: Use the == operator

    B: Use the .equals() method

    C: Use Arrays.equals() method

    D: Compare each element one by one

    Ans: C
  11. How do you access the fourth element of an array named numbers?

    A: numbers[4];

    B: numbers(3);

    C: numbers[3];

    D: numbers.get(3);

    Ans: C
  12. Which of the following operators is used for concatenation of two strings?

    A: +

    B: *

    C: &

    D: +=

    Ans: A
  13. Which of the following creates a mutable string?

    A: String

    B: StringBuilder

    C: StringChar

    D: StringMutable

    Ans: B
  14. In Java, strings are:

    A: Primitive data types

    B: Immutable objects

    C: Mutable objects

    D: Arrays of characters

    Ans: B
  15. How do you find the length of a string named 'example'?

    A: example.size()

    B: example.length()

    C: example.getLength()

    D: example.len()

    Ans: B
  16. What is the result of the expression "Java" + "Programming"?

    A: JavaProgramming

    B: Java Programming

    C: Java-Programming

    D: JavaProgramming-

    Ans: A
  17. Which method is used to compare two strings for equality?

    A: ==

    B: equals()

    C: compare()

    D: isEqual()

    Ans: B
  18. Which class can create a string that is thread-safe?

    A: String

    B: StringBuffer

    C: StringBuilder

    D: StringSafe

    Ans: B
  19. What is the root class for all Java classes?

    A: Object

    B: Class

    C: Superclass

    D: Root

    Ans: A
  20. What is polymorphism?

    A: Multiple forms

    B: Single form

    C: No form

    D: Static form

    Ans: A
  21. What is encapsulation in Java?

    A: The process of combining data and methods into a single unit

    B: The process of hiding data and methods within a class

    C: The process of creating multiple instances of a class

    D: The process of reusing code from existing classes

    Ans: B
  22. What is inheritance in Java?

    A: The process of creating multiple instances of a class

    B: The process of hiding data and methods within a class

    C: The process of reusing code from existing classes

    D: The process of combining data and methods into a single unit

    Ans: C
  23. What is polymorphism in Java?

    A: The ability of a class to inherit properties and behaviors from another class

    B: The process of hiding data and methods within a class

    C: The process of creating multiple instances of a class

    D: The ability of an object to take on many forms

    Ans: D




 


.

Recently Updated: New Placement Papers added.
Vyom Network : Web Hosting | Dedicated Server | Free SMS, GRE, GMAT, MBA | Online Exams | Freshers Jobs | Software Downloads | Programming & Source Codes | GRE Preparation | Jobs, Discussions | Software Listing | Free eBooks | Free eBooks | Free Business Info | Interview Questions | Free Tutorials | International Business Information | IAS Preparation | Jokes, Songs, Fun | Free Classifieds | Free Recipes | FAQs | Free Downloads | Bangalore Info | Tech Solutions | Project Outsourcing, Web Hosting | GATE Preparation | MBA Preparation | SAP Info | Excellent Mobiles | Software Testing | Interview Questions | Freshers Jobs | Server Insiders | File Extension Directory

Copyright ©2003-2024 Vyom Technosoft Pvt. Ltd., All Rights Reserved. Read our Privacy Policy