[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.

Basic Concepts Questions

NA
SHSTTON
76
Solv. Corr.
114
Solv. In. Corr.
190
Attempted
0 M:26 S
Avg. Time

21 / 64

Choose the correct option.

What is the result of evaluating the expression 14 ^ 23. Select the one correct answer.


A25

B37

C6

D31

E17

Answer: Option A

Explanation:

^ is the symbol for XOR operator, which results in 0 when the bits are same, and 1 when the bits are different.

14 in binary can be represented as = 0000 1110

23 in binary can be represented as = 0001 0111

Therefore,         14 ^ 23                   = 0001 1001

which is equal to 25.
            

Workspace

NA
SHSTTON
35
Solv. Corr.
154
Solv. In. Corr.
189
Attempted
0 M:44 S
Avg. Time

22 / 64

What all gets printed when the following program is compiled and run. Select the one correct answer.
public class test {
public static void main(String args[]) {
inti=0, j=2;
do {
i=++i;
j—;
      } while(j>0);
System.out.println(i);
   }
}

A    0

B    1

C    2

DThe program does not compile because of statement "i=++i;"

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
103
Solv. Corr.
65
Solv. In. Corr.
168
Attempted
0 M:0 S
Avg. Time

23 / 64

What all gets printed when the following gets compiled and run.
public class test {
public static void main(String args[])
{
inti=1, j=1;
try
{ i++;
j–;
if(i/j > 1)
i++;
}
catch(ArithmeticException e)
{
System.out.println(0);
}
catch(ArrayIndexOutOfBoundsException e)
{
System.out.println(1);
}
catch(Exception e)
{
System.out.println(2);
}
finally
{
System.out.println(3);
}
System.out.println(4);
}
}

A0,3,4

B1,3,4

C0,2,4

D0,3,4

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
132
Solv. Corr.
68
Solv. In. Corr.
200
Attempted
0 M:0 S
Avg. Time

24 / 64

What all gets printed when the following gets compiled and run.
public class test {
public static void main(String args[]) {
String s1 = "abc";
String s2 = "abc";
if(s1 == s2)
System.out.println(1);
else
System.out.println(2);
if(s1.equals(s2))
System.out.println(3);
else
System.out.println(4);
}
}

A1,3

B1,4

C3,4

D2,4

Answer: Option A

Explanation:

Now, the == operator is meant for always for reference comparison, i.e., it will result True if the string objects are same else False. On the other hand, equals() method defined in the String class is meant for content comparison, i.e, it will result True if the contents are same else False.

Here, the content of s1 and s2 is "abc", so in the String constant pool, a single object is created having the content as "abc", and s1 and s2 both will refer to the same object created. Since, both are referring to the same string object, hence (s1==s2) becomes True, and if part will execute.

On the other hand, the content for both s1 and s2 are the same, hence "s1.equals(s2)"  also becomes True, so again the if part gets executed.

Therefore, the output will be-

1

3

Workspace

NA
SHSTTON
84
Solv. Corr.
89
Solv. In. Corr.
173
Attempted
0 M:0 S
Avg. Time

25 / 64

What all gets printed when the following gets compiled and run.
public class test {
public static void main(String args[]) {
String s1 = "abc";
String s2 = new String("abc");
if(s1 == s2)
System.out.println(1);
else
System.out.println(2);
if(s1.equals(s2))
System.out.println(3);
else
System.out.println(4);
}
}

A1,2

B1,3

C2,3

D   4

Answer: Option C

Explanation:

String s1="abc";----------------> In this declaration, only one String object will be created in the String constant pool, and s1 will be pointing to that object.

String s2=new String("abc");---------->In this declaration, 2 objects will be created-one in the Heap area, and the other in the String constant pool, and s2 will always be pointing to the Heap area. But, already an object is created having the same content "abc". So, the existing object will be re-used.

                        Heap                                                                        String constant pool

           s2----------->"abc"                                                                     "abc"<---------------s1

Now, the == operator is meant for always for reference comparison, i.e., it will result True if the string objects are same else False. On the other hand, equals() method defined in the String class is meant for content comparison, i.e, it will result True if the contents are same else False.

Here, (s1==s2) will result in False, as s1 is referring to the object in String constant pool, while s2 is referring to the object in the Heap, so the else part gets executed.

On the other hand, "s1.equals(s2)" will result in True because their contents are same, so the if part gets executed.

Hence, the output is-

2

3






Workspace

NA
SHSTTON
19
Solv. Corr.
152
Solv. In. Corr.
171
Attempted
1 M:36 S
Avg. Time

26 / 64

Choose the correct option.
Which of the following are legal array declarations.

Ainti[5][]; inti[5][5];

Binti[][]; int []i[]

Cint []i[]; inti[5][5];

Dinti[5][5];

Einti[][]; , int []i[]; , int[][] a;

Answer: Option E

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
48
Solv. Corr.
122
Solv. In. Corr.
170
Attempted
0 M:0 S
Avg. Time

27 / 64

Choose the correct option.

What is the range of values that can be specified for an int. Select the one correct answer.


AThe range of values is compiler dependent.

B-231 to 231 – 1

C-231-1 to 231

D-215 to 215 – 1

E-215-1 to 215

Answer: Option B

Explanation:

231 to 231 – 1

Workspace

NA
SHSTTON
99
Solv. Corr.
68
Solv. In. Corr.
167
Attempted
0 M:0 S
Avg. Time

28 / 64

What gets printed when the following code is compiled and run. Select the one correct answer.
public class test {
public static void main(String args[]) {
inti = 1; 
do
{
i–;
} while (i> 2);
System.out.println(i);
}
}

A    0

B    1

C    2

D   -1

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
19
Solv. Corr.
146
Solv. In. Corr.
165
Attempted
0 M:0 S
Avg. Time

29 / 64

At what stage in the following method does the object initially referenced by s becomes available for garbage collection. Select the one correct answer.
void method X() {
String r = new String("abc");
String s = new String("abc");
r = r+1; //1
r = null; //2
s = s + r; //3
} //4

ABefore statement labeled 1

BBefore statement labeled 2

CBefore statement labeled 3

DBefore statement labeled 4

ENever

Answer: Option D

Explanation:

Before the statement labelled 4, the object s becomes available and eligible for garbage collection. The garbage collection activity is done by the garbage collector thread, whose work is to sweep out abandoned objects, or the objects which do not have any live reference anymore. The garbage collector thread comes once in a while in the heap area, and when it finds any abandoned objects, it sweeps out the abandoned objects after calling the finalize() method on that object.


Workspace

NA
SHSTTON
70
Solv. Corr.
85
Solv. In. Corr.
155
Attempted
0 M:0 S
Avg. Time

30 / 64

Choose the correct option.

String s = new String("xyz");
Assuming the above declaration, which of the following statements would compilation. Select the one correct answer.


As = 2 * s;

Binti = s[0];

Cs = s + s;

Ds = s >> 2;

ENone of the above

Answer: Option C

Explanation:

Option C is correct, because 's' is String type object. s=s+s, means s="xyz"+"xyz", so s="xyzxyz". Rest all other are not possible, hence it won't compile.

Workspace

JAVA Programming Basic Concepts Questions and Answers pdf

At JAVA Programming topic Basic Concepts page No: 3 you will find list of 10 practice questions, tips/trick and shortcut to solve questions, solved questions, quiz, and download option to download the whole question along with solution as pdf format for offline practice. You can practice all the listed JAVA Programming Basic Concepts topic questions offline too, by downloading the MCQs practice question of Basic Concepts with detail solution, with formula/Tips & Tricks, with Solved examples and with top-rated users answers, which will give you best answer ascross webs. It is one of the perfect Basic Concepts e-book pdf covering all types of questions in detail. These JAVA Programming test with answers pdf cover all types of question asked in IIFT, XAT, SNAP, GRE, GMAT, NMAT, CMAT, MAT or for IT companies written exam like Wipro, HCL, Infosys, Accenture, Government exams, IBPS Exams etc. There are multiple formats to download your online free JAVA Programming Basic Concepts e-book, like fully solved, unsolved questions with Answers sheet. Even you can customize your ebook format by adjusting the given options in the download section to make it your one of the best JAVA Programming topic-based ebook. It is recommended to bookmark this page JAVA Programming Basic Concepts for your preparation. Most of the students and fresher candidates finding it hard to clear the JAVA Programming section in exams. Here Given Basic Concepts practice questions, quiz, fully solved questions, tips & trick and Mock tests, which include question from each topic will help you to excel in Basic Concepts. Each test has all the basics questions to advanced questions with answer and explanation for your clear understanding, you can download the test result as pdf for further reference.

At JAVA Programming topic Basic Concepts, you will get multiple online quiz difficulty wise, which will have a total of 6 quizzes, categorized as easy, medium, and moderate level. While preparing for any Basic Concepts, take all the list quiz and check your preparation level for that topic. Each quiz have 10 different question, which needs to be answered in 20 min., all the listed quiz here is free, however, you will get only one chance for each quiz to attempt(Take Quiz seriously), so it is always recommended to take one quiz in each section before you start solving Basic Concepts MCQs practice question, and one after solving all the question of the respective level, you can refer back your Basic Concepts quiz result any time or you can download it as pdf for reference.

JAVA Programming Basic Concepts Customize Online Mock Test

This is own type of mock test, where At this JAVA Programming Basic Concepts MCQs mock test section, you will able to attempt only the questions related to Basic Concepts, in that question will be a different level, important, and all the questions will be part of some of the mock tests across Q4interview FREE Mock test. You need to choose the topic as Basic Concepts, and click on Double click to generate your customize mock test. While attempting the mock test you need to choose any of the one options out of given option. It is recommended to go through the direction given along with each question, as these questions will be randomly and so that same direction will not be applicable across the entire test. Once you submit your mock test, the result will be generated for Basic Concepts Customize mock test, where your performance point points will be highlighted. Q4interview analysis every single point which helps you to improve your topic understanding and help you to know your type of mistakes and way to improve Basic Concepts questions, by providing the same type of practice questions from practice exercise. The best part of this Basic Concepts, all these mock tests listed here are free and you can take as Many time, as many you want. When you continue to give Basic Concepts Customize Online Mock Test here regularly, then you will understand how much you have developed your accuracy on a topic, after that you will be able to decide how much attention you need to focus on. Your continued practice will increase your confidence, speed and thinking ability intensely, the Basic Concepts Customize topic on which you will practice more will beneficial for you in future during campus placement.Basic Concepts Mock Tests

JAVA Programming Basic Concepts Quiz Online Test

The details of the JAVA Programming Basic Concepts quiz are as follows. There are 10 questions for you. You have to answer them in 20 minutes. Within 20 minutes you have to see the errors in the sentences given as a question. Four options are also given to you, and you have to choose your opinion. You must be confident in your answer that the choices are difficult. Therefore, below we provide you with some information about JAVA Programming Basic Concepts that you see and keep them in mind while answering questions.

JAVA Programming Basic Concepts MCQs Practice Questions with Answer

On this Basic Concepts section of page you will find the easiest quickest ways to solve a question, formulas, shortcuts and tips and tricks to solve various easiest methods to solve Basic Concepts Question Quickly. It contains all the JAVA Programming topic Basic Concepts questions which are common in any of the preliminary exams of any company. The solution is provided along with the questions. The practice of these questions is a must as they are easy as well as scoring and asked in all the exams They will confirm the selection if all the questions attempted wisely with little practice. It is recommanded to Take Mock test based on JAVA Programming topic and Basic Concepts topic based quiz.

JAVA Programming Basic Concepts solved examples question

Clarity of concepts is a must if you want to master the skill of solving JAVA Programming problems. This page contains sample JAVA Programming Basic Concepts questions and answers for freshers and competitive exams. Basic Concepts Questions with the detailed description, the explanation will help you to master the topic. Here solved examples with detailed answer description, explanations are given and it would be easy to understand. How to solve qBasic ConceptsJAVA Programming? Here are some examples solved with the Common Rules/tricks/tips of JAVA Programming. Enhance your chance to score maximum marks in JAVA Programming sections through. Error Spotting Grammar Questions Online Test for Free. Fully solved Sentence Formation MCQs questions with detailed answer description. JAVA Programming is an important topic for any exams but most aspirants find it difficult. You need to learn various tricks tips, rules, etc to solve quickly. At this page, you will find frequently asked Basic Concepts questions or problems with solutions, shortcuts, formulas for all-important competitive exams like IT companies exams, interviews. It is always a best practice to go through the example and understand the types of question and way to solve it, so let's do some examples to calculate efficiency, read through all the given here solved examples. You can post your solution, tips, trick and shortcut if you have any in respect to questions.

You can get here fully solved Basic Concepts examples with a detailed answer and description. You can solve Basic Concepts problems with solutions, the questions by companies wise by filtering the questions, additionally, you can check what type of questions are being asked in IT companies Written Round from Basic Concepts. Basic Concepts became one of the most important sections in the entire competitive exams, Companies Campus, and entrance online test. Go through Basic Concepts Examples, Basic Concepts sample questions. You can Evaluate your level of preparation in Basic Concepts by Taking the Q4Interivew Basic Concepts Online Mock Test based on most important questions. All the Basic Concepts practice questions given here along with answers and explanations are absolutely free, you can take any number of time any mock Test.

Why JAVA Programming Basic Concepts?

In this practice section, you can practice JAVA Programming Questions based on "Basic Concepts" and improve your skills in order to face the interview, competitive examination, IT companies Written exam, and various other entrance tests (CAT, GATE, GRE, MAT, Bank Exam, Railway Exam etc.) with full confidence.

Where can I get JAVA Programming Basic Concepts questions and answers with explanation?

Q4Interview provides you lots of fully solved JAVA Programming (Basic Concepts) questions and answers with Explanation. Solved examples with detailed answer description, explanation are given and it would be easy to understand. You can download JAVA Programming Basic Concepts quiz questions with answers as PDF files and eBooks.

Where can I get JAVA Programming Basic Concepts Interview Questions and Answers (objective type, multiple-choice, quiz, solved examples)?

Here you can find objective type JAVA Programming Basic Concepts questions and answers for interview and entrance examination. Multiple choice and true or false type questions are also provided.