[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
13
Solv. Corr.
101
Solv. In. Corr.
114
Attempted
0 M:0 S
Avg. Time

41 / 64

What is the output for the below code?
public class Test {
public static void main(String[] args){
byte b = 6;
b+=8;
System.out.println(b);
b = b+7;
System.out.println(b);
}
}

A14 21

B14 13

CCompilation fails with an error at line 6

DCompilation fails with an error at line 4

Answer: Option C

Explanation:

int or smaller expressions always resulting in an int. So compiler complain about Type mismatch: cannot convert from int to byte for b = b+7; But b += 7;
because +=, -=, *=, and /= will all put in an implicit cast. b += 7 is same as b = (byte)b+7.

Workspace

NA
SHSTTON
42
Solv. Corr.
86
Solv. In. Corr.
128
Attempted
0 M:0 S
Avg. Time

42 / 64

What is the output for the below code?
public class Test {
public static void main(String[] args){
String value = "abc";
changeValue(value);
System.out.println(value);
}
public static void changeValue(String {
a = "xyz";
}
}

Aabc

Bxyz

CCompilation fails

DCompilation clean but no output

Answer: Option A

Explanation:

Java pass reference as value. passing the object reference, and not the actual object itself. The parameter is essentially a local variable.

Workspace

NA
SHSTTON
30
Solv. Corr.
70
Solv. In. Corr.
100
Attempted
0 M:0 S
Avg. Time

43 / 64

What is the output for the below code?
public class Test {
public static void printValue(int i, int j, int k){
System.out.println("int");
}
public static void printValue(byte...b){
System.out.println("long");
}
public static void main(String... args) {
byte b = 9;
printValue(b,b,b);
}
}

Along

Bint

CCompilation fails

DCompilation clean but throws RuntimeException

Answer: Option B

Explanation:

Primitive widening uses the smallest method argument possible.

Workspace

NA
SHSTTON
126
Solv. Corr.
294
Solv. In. Corr.
420
Attempted
0 M:19 S
Avg. Time

44 / 64

Choose the correct option.

You have a java file name Test.java inside src folder of javaproject directory.
You have also classes folder inside javaproject directory.
you have issued below command from command prompt.
cd javaproject
Which of the below command puts Test.class file inside classes folder ?


Ajavac -d classes src/Test.java

Bjavac Test.java

Cjavac src/Test.java

Djavac classes src/Test.java

Answer: Option A

Explanation:

The -d option lets you tell the compiler in which directory to put the .class file it generates (d for destination)

Workspace

NA
SHSTTON
92
Solv. Corr.
105
Solv. In. Corr.
197
Attempted
0 M:0 S
Avg. Time

45 / 64

What is the result of compiling and running the following program.
public class test {
public static void main(String args[]) {
String str1="abc";
String str2="def";
String str3=str1.concat(str2);
str1.concat(str2);
System.out.println(str1);
}
}

Aabc

Bdef

Cabcabc

Dabcdef

Edefabc

Answer: Option A

Explanation:

The output is abc, because the content of str1 is "abc".

Don't get confused by line no. 6 i.e, str1.concat(str2);

We are concatinating str1 with str2, but the resultant string having the content as "abcdef" has no reference. It's definitely not that str1 refers to "abcdef"

Workspace

NA
SHSTTON
75
Solv. Corr.
40
Solv. In. Corr.
115
Attempted
0 M:0 S
Avg. Time

46 / 64

What is the Output of the below code.
public class Base {
 public void method(int i) {
  System.out.println("Base class Value is" + i);
 }
}
public class Sub extends Base {
 public void method(int j) {
  System.out.println("Sub class Value is" + j);
 }

public static void main(String args[]) {
 Base b1 = new Base();
 Base b2 = new Sub();
 b1.method(5);
 b2.method(6);
}
}

ABase class Value is 5 Sub class Value is 5

BBase class Value is 5 Sub class Value is 6

CBase class Value is 6 Sub class Value is 6

DNone

Answer: Option B

Explanation:

In line no. 11 i.e, Base b1=new Base(); we have created an object of Base class and it's reference is also of Base class. In such a case when b1.method(5); is invoked, Base class method is invoked and we gets an output as Base class value is 5.

On the other hand, line no. 12 i.e, Base b2=new Sub(); we have created an object of Sub class but it's reference is of Base class. In such a case when b2.method(6); is invoked, Sub class method gets invoked, and we get the output as Sub class value is 6.  

Workspace

NA
SHSTTON
42
Solv. Corr.
25
Solv. In. Corr.
67
Attempted
0 M:0 S
Avg. Time

47 / 64

Choose the correct option.

Which of these classes defined in javio and used for file-handling are abstract. Select the two correct answers.


AInputStream

BPrintStream, FileWriter

CReader

DFileInputStream

EBoth A & C

Answer: Option E

Explanation:

The correct option is InputStream and Reader, which are defined in java.io package and are used for file handling. 

Workspace

NA
SHSTTON
72
Solv. Corr.
150
Solv. In. Corr.
222
Attempted
0 M:8 S
Avg. Time

48 / 64

Choose the correct option.

Which of the following statement is true about jar command?


AThe jar command creates the META-INF directory implicitly.

BThe jar command creates the MANIFEST.MF file implicitly.

CThe jar command would not place any of your files in META-INF directory.

DAll of the above are true

Answer: Option D

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
14
Solv. Corr.
93
Solv. In. Corr.
107
Attempted
0 M:0 S
Avg. Time

49 / 64

What is the output of the below code.
public class Example {
int x = 50;
int y = 100;
public static void main(String args[]) {
int x = 0, y = 10;
Example ex = new Example();
while(x <  {
 x++; y--;
}
System.out.println("X = "+x+",Y ="+y);
}
}

ACompilation fails because of an error at line 8

Bx = 3, y = 7

CRuntime Error

DCompilation fails because of an error at line 9

Ex=53, y=97

Answer: Option B

Explanation:

x = 3, y = 7

Workspace

NA
SHSTTON
12
Solv. Corr.
85
Solv. In. Corr.
97
Attempted
0 M:0 S
Avg. Time

50 / 64

Choose the correct option.
String valid = "true";
if(valid)
 System.out.println("valid");
else 
 System.out.println("not valid");

Avalid

Bnot valid

CCompilation fails

DAn illegal argument exception thrown at runtime

Answer: Option C

Explanation:

We get an error in this case, because valid is of String type, and in the if part we are actually comparing a String object with a Boolean value, which is not possible.

Hence, we get an error saying, incompatible types : String cannot be converted to Boolean.

Workspace

JAVA Programming Basic Concepts Questions and Answers pdf

At JAVA Programming topic Basic Concepts page No: 5 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.