Skip to content
GK24
Computer AwarenessHardAsked in: RRB JE · 30 Aug 2019

Which of the following is NOT a java primitive type?

  1. A.short
  2. B.long
  3. C.long double
  4. D.boolean

Correct answer

C. long double

Explanation

The correct answer is C, long double. Java has exactly eight primitive data types, namely byte, short, int, long, float, double, char and boolean, and long double is not among them; it belongs to C and C++, where it denotes an extended precision floating point number, so the option is a deliberate trap for candidates who have learnt C first. Option A is wrong as an answer because short is a genuine Java primitive, a sixteen-bit signed integer. Option B is wrong because long is also genuine, a sixty-four-bit signed integer used when int is too small. Option D is wrong because boolean is a primitive that holds only the two values true and false and is the type of every condition in Java. A useful way to hold the eight in mind is to group them: four integer types, two floating point types, one character type and one logical type.

Read the full article: Programming Languages: Generations, Compilers and PYQs

View all
Q2.Computer AwarenessEasy

The C programming language was developed by:

  1. A.James Gosling
  2. B.Bjarne Stroustrup
  3. C.Dennis Ritchie
  4. D.Guido van Rossum
Show answer
Correct answer: C. Dennis Ritchie

He created C at Bell Laboratories in the early 1970s and used it to rewrite the UNIX operating system, which is why C is called the mother of system programming languages and still underlies most operating systems.

Q3.Computer AwarenessAsked in: RRB JE · 30 Aug 2019Medium

What is the use of the 'javac' command?

  1. A.Execute a java program
  2. B.Debug a java program
  3. C.Interpret a java program
  4. D.Compile a java program
Show answer
Correct answer: D. Compile a java program

The command javac is the Java compiler: it takes a source file with the extension.java, checks its grammar and converts it into a class file containing bytecode, the intermediate code that any Java Virtual Machine can run.

Q4.Computer AwarenessEasy

Which translator converts a high-level program into machine language one statement at a time?

  1. A.Compiler
  2. B.Interpreter
  3. C.Assembler
  4. D.Loader
Show answer
Correct answer: B. Interpreter

An interpreter reads one statement of the source program, translates it and executes it immediately before moving to the next, so it stops at the first error it meets and tells the programmer about that error alone; this makes it convenient for learning and for testing small pieces of code…

Q5.Computer AwarenessAsked in: RRB JE · 30 Aug 2019Medium

Which of the following is/are the rules to declare variables in Java?

  1. A.Java keywords cannot be used as variable names
  2. B.All of the options
  3. C.Variable names are case-sensitive
  4. D.The first character must be a letter
Show answer
Correct answer: B. All of the options

The correct answer is B, all of the options, because each of the other three statements is a genuine rule of the language and the question asks which of them apply.