0% found this document useful (0 votes)
13 views

Java_Quiz1 - Google Forms

Uploaded by

Gomathy
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Java_Quiz1 - Google Forms

Uploaded by

Gomathy
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

07/10/2024, 10:27 Java_Quiz1 07/10/2024, 10:27 Java_Quiz1

6. The name "JAVA" is known to the world as? 1 point

Java_Quiz1 Mark only one oval.

* Indicates required question A) A Tea Brand in India

B) A Coffee Brand in Africa

1. Email * C) An Island in Indonesia

D) Ragi Malt Juice

7. Java language was originally developed for operating? 1 point


2. Batch No.
Mark only one oval.

A) TV

B) TV Set-top box
3. Name
C) Embedded System equipment

D) All the above

4. Who invented Java language? 1 point


8. What is the advantage of EXE files? 1 point
Mark only one oval.
Mark only one oval.
A) Dennis Ritchie

B) James Gosling A) Run Faster

C) Larry Page B) Efficient

D) Serge Page C) No separate program required to run

D) All the above

5. What is the original name of Java Programming language? 1 point

9. Computer Viruses and Trojans are often transmitted along with which files? 1 point
Mark only one oval.
Mark only one oval.
A) J++

B) C++ A) JPG files

C) OAK B) TXT files

D) TEAK C) EXE files

D) .ICO files

https://docs.google.com/forms/d/1F6WyHf2YQ5ONlAIyPcQ0bC0CBfBjCu5WhFfSwh-95mU/edit 1/15 https://docs.google.com/forms/d/1F6WyHf2YQ5ONlAIyPcQ0bC0CBfBjCu5WhFfSwh-95mU/edit 2/15

07/10/2024, 10:27 Java_Quiz1 07/10/2024, 10:27 Java_Quiz1

10. What is an Interpreter? 1 point 14. What software compiles a Java Program? 1 point

Mark only one oval. Mark only one oval.

A) An interpreter converts instructions line by line A) JRE (Java Runtime Environment)

B) An Interpreter converts source code to low-level code B) JDK (Java Developer Kit)

C) Interpreters are slow to execute C) JVM (Java Virtual Machine)

D) All the above D) Command Prompt

11. What is a Compiler? 1 point 15. What software runs a Java program on a computer? 1 point

Mark only one oval. Mark only one oval.

A) A Compiler converts all instructions in one go. A) JRE (Java Runtime Environment)

B) A compiler converts source code to low-level code B) JDK (Java Developer Kit)

C) Compilers work fast C) Command Prompt

D) All the above D) operating system(such as windows)

12. What is the output of Compilation of Java Program? 1 point 16. What does JVM stands for? 1 point

Mark only one oval. Mark only one oval.

A) .class file A) Java Variable Machine

B) .cla file B) Java Virtual Machine

C) .jc file C) Java Virtual Mechanism

D) .javax file D) None of the above

13. Byte code is the result of? 1 point 17. What is Portability offered by Java language? 1 point

Mark only one oval. Mark only one oval.

A) Compiling a Java file A) Small code size easy to carry occupying less disk space

B) Compiling a Class file B) Generating suitable Byte Code for each machine by the Compiler

C) Interpreting a Java File C) Ability to run the Byte on different machines producing the same behaviour
and output
D) Interpreting a Class file
D) Java does not actually provide portability

https://docs.google.com/forms/d/1F6WyHf2YQ5ONlAIyPcQ0bC0CBfBjCu5WhFfSwh-95mU/edit 3/15 https://docs.google.com/forms/d/1F6WyHf2YQ5ONlAIyPcQ0bC0CBfBjCu5WhFfSwh-95mU/edit 4/15


07/10/2024, 10:27 Java_Quiz1 07/10/2024, 10:27 Java_Quiz1

18. What is JIT in Java? 1 point 21. Every statement in Java language should end with a? 1 point

Mark only one oval. Mark only one oval.

A) Java In Timer A) Dot or Period

B) Java In Time Thread B) Comma

C) Just In Time Compiler C) Semicolon

D) Just In Time Runnable D) Colon

19. What is the Java command used to compile a java program hello.java 2 points 22. What is the need to mention "static" before main method? 1 point

from Command Line or Command Prompt or CMD?


Mark only one oval.
Mark only one oval.
A) To call main method without creating an object of class
A) >java hello.java
B) To make main method as class method common to all instances
B) >javac hello.java
C) Both A and B
C) >javacomp hello.java
D) None of the above
D) >javacmd hello.java

23. What is the use of Access modifier "pubic" in Java language? 1 point
20. What is the command used to Run a Java program form Command Line or 1 point
Command Prompt or CMD? Mark only one oval.

Mark only one oval. A) To hide the main method from misuse

B) To call the main method outside of Class or Package by JVM


A) javac hello
C) To protect main method
B) java hello.class
D) None of the above
C) java hello

D) java hello.java

24. What is the default return type of a method in Java language? 1 point

Mark only one oval.

A) void

B) int

C) short

D) None of the above

https://docs.google.com/forms/d/1F6WyHf2YQ5ONlAIyPcQ0bC0CBfBjCu5WhFfSwh-95mU/edit 5/15 https://docs.google.com/forms/d/1F6WyHf2YQ5ONlAIyPcQ0bC0CBfBjCu5WhFfSwh-95mU/edit 6/15

07/10/2024, 10:27 Java_Quiz1 07/10/2024, 10:27 Java_Quiz1

25. Name of a Class, Variable, Method or an Interface in Java language is 1 point 29. Which among the following is not a valid Data Type in Java? 1 point

called?
Mark only one oval.
Mark only one oval.
A) long
A) Argument
B) bool
B) Value
C) double
C) Identifier
D) float
D) None of the above

30. Choose the number range for byte data type in Java? 1 point
26. What does a Data Type in Java refers to? 1 point
Mark only one oval.
Mark only one oval.
A) -127 to +128
A) The place where data is stored
B) -128 to +127
B) The technique how data is retreived
C) 0 to 256
C) The type or variety of data being handled for reading and writing
D) 0 to 255
D) None of the above

31. What is the size of a SHORT integer in Java? 1 point


27. Choose the wrong statement about Java programming? 1 point
Mark only one oval.
Mark only one oval.
A) 1 byte
A) Java supports unsigned integers
B) 2 bytes
B) Java supports signed integers
C) 4 bytes
C) Java supports signed char
D) 8 bytes
D) None of the above

32. What is the size of an INT integer in Java? 1 point


28. which among the following is not a Data Type in Java? 1 point
Mark only one oval.
Mark only one oval.
A) 2 bytes
A) short
B) 4 bytes
B) int
C) 6 bytes
C) long double
D) 8 bytes
D) double

https://docs.google.com/forms/d/1F6WyHf2YQ5ONlAIyPcQ0bC0CBfBjCu5WhFfSwh-95mU/edit 7/15 https://docs.google.com/forms/d/1F6WyHf2YQ5ONlAIyPcQ0bC0CBfBjCu5WhFfSwh-95mU/edit 8/15


07/10/2024, 10:27 Java_Quiz1 07/10/2024, 10:27 Java_Quiz1

33. What is the size of a CHAR data type constant in Java? 1 point 37. An Octal number is Java is represented with a leading ____? * 1 point

Mark only one oval. Mark only one oval.

A) 1 byte A) O (Alphabet)

B) 2 bytes B) 0 (ZERO)

C) 4 bytes C) 0x

D) 6 bytes D) 0X

34. Choose the right statement about Java Data types. 38. What is the name given to character literals in Java that start with a Back 1 point

Slash character?
Mark only one oval.
Mark only one oval.
A) Integer data types are short, int and long

B) Real number data types are float and double A) Back Slash Sequence

C) The character data type is char. B) Slash Sequence

D) All the above C) Escape Sequence

D) Extended Sequence

35. What is Literal in Java? 1 point

39. What is the suffix used to represent a floating point number in Java? 1 point
Mark only one oval.
Mark only one oval.
A) Literal is the value that is given or assigned to a variable.

B) Literal is a data type A) r or R

C) Literal is similar to String B) f or F

D) None of the above C) fl or FL

D) None of the above

36. Choose correct examples of decimal literals in Java. 1 point

40. A character literal in Java is enclosed within a pair of ___? 1 point


Mark only one oval.
Mark only one oval.
A) int a = 12345;

B) int a = 1235; A) Square brackets

C) long a = 987654321L; B) Double Quotes

D) All the above C) Single Quotes

D) Exclamations

https://docs.google.com/forms/d/1F6WyHf2YQ5ONlAIyPcQ0bC0CBfBjCu5WhFfSwh-95mU/edit 9/15 https://docs.google.com/forms/d/1F6WyHf2YQ5ONlAIyPcQ0bC0CBfBjCu5WhFfSwh-95mU/edit 10/15

07/10/2024, 10:27 Java_Quiz1 07/10/2024, 10:27 Java_Quiz1

41. What is the output of this Java snippet? 1 point 45. What is a Widening Type Conversion in Java? 1 point
int a = 0b111;
System.out.println(a); Mark only one oval.

Mark only one oval. A) Conversion of data from higher data type to lower data type

B) Conversion of data from lower data type to higher data type


A) 111
C) Conversion of data from any data type to any data type
B) 7
D) None of the above
C) 8

D) Compiler error

46. What is a Narrowing Type Conversion in Java? 1 point

42. Choose the wrong Java code statement below. 1 point Mark only one oval.

Mark only one oval. A) Conversion of data from lower data type to higher data type

B) Conversion data from a higher data type to a lower data type


A) boolean a = false;
C) Conversion of data from any data type to any data type
B)boolean a = (5>6)||(4>3);
D) None of the above
C)boolean a = 1;

D) boolean a = 4>3?true:false;

47. What is the result of a Narrowing type conversion? 1 point

43. Choose the wrong Java code statement below. 1 point Mark only one oval.

Tick all that apply. A) Loss of data

A) char a ='a'; B) Addition of data

B) char a ="ab"; C) Corruption of data


C) char a =97; D) None of the above
D) char a ='\u0123';

48. Explicit Type Conversion in Java refers to ___? 1 point


44. What are the Type Conversions available in Java language? 1 point

Mark only one oval.


Mark only one oval.
A) Narrowing Type Conversion
A) Narrowing Type Conversion
B) Widening Type Conversion
B) Widening Type Conversion
C) No Type Conversion
C) A and B
D) None of the above
D) None of the above

https://docs.google.com/forms/d/1F6WyHf2YQ5ONlAIyPcQ0bC0CBfBjCu5WhFfSwh-95mU/edit 11/15 https://docs.google.com/forms/d/1F6WyHf2YQ5ONlAIyPcQ0bC0CBfBjCu5WhFfSwh-95mU/edit 12/15


07/10/2024, 10:27 Java_Quiz1 07/10/2024, 10:27 Java_Quiz1

49. What is the output of the below Java code snippet? 1 point 52. A boolean literal in Java can be type casted to which data type? 1 point
float a = 8.2/2;
Mark only one oval.
System.out.println(a);

Mark only one oval. A) byte

B) short
A) 4.1
C) int
B) 8.1
D) None of the above
C) 4

D) Compiler error

53. What is the output of the Java code snippet? 1 point


int a=5, b=10, c=15;
50. What is the output of the Java code snippet? 1 point a -= 3; b *= 2; c /= 5;
byte b = 25; System.out.println(a +" " + b + " " + c);
b++;
Tick all that apply.
b = b+1;
System.out.println(b); A) 2 20 3
B) 2 20 5
Mark only one oval.
C) 2 10 5

A) 25 D) -2 20 3

B) 26

C) 27
54. What is the output of the Java code snippet? 1 point
D) Compiler error
int a=10, b=6;
int c = a+b*5;
System.out.println(c);
51. What is the output of the Java code snippet? int a = 260; byte b= 1 point
Mark only one oval.
(byte)a; System.out.println(b);
A) 40
Mark only one oval.
B) 50
A) 0 C) 80
B) 4 D) Compiler error
C) 255

D) 260

https://docs.google.com/forms/d/1F6WyHf2YQ5ONlAIyPcQ0bC0CBfBjCu5WhFfSwh-95mU/edit 13/15 https://docs.google.com/forms/d/1F6WyHf2YQ5ONlAIyPcQ0bC0CBfBjCu5WhFfSwh-95mU/edit 14/15

07/10/2024, 10:27 Java_Quiz1

55. What is the output of the Java code snippet? 1 point


int a=10, b=5, c=3;
int d = a+c/2*b;
System.out.println(d);

Mark only one oval.

A) 17.5

B) 32.5

C) 15

D) 30

56. What is the output of the Java code snippet? 1 point


int a=6, b=5;
if(++b == a--) {
System.out.println("RABBIT");
}
else {
System.out.println("BUNNY");
}

Mark only one oval.

A) RABBIT

B) BUNNY

C) Compiler error

D) None of the above

This content is neither created nor endorsed by Google.

Forms

https://docs.google.com/forms/d/1F6WyHf2YQ5ONlAIyPcQ0bC0CBfBjCu5WhFfSwh-95mU/edit 15/15

You might also like