filmov
tv
Java Code Quiz - Java Code General Knowledge Trivia Questions and Answers | Java Code Test

Показать описание
Test your programming general knowledge: Take Code Camp's Java Code Quiz! Can you answer all 20 coding basics questions in 10 seconds or less?
This Java code quiz will test you on the foundational basics of the language.
Share with those starting their programming journey!
** Java Programming Trivia Questions And Answers:
2) Which of the following is a multi-line comment in Java? - /* This is a comment */
3) This declares a string x in Java. - String x;
4) How do you create an integer with a value of 10? - int num = 10;
5) Declare a floating point variable with a value of 3.14 - float num = 3.14f;
7) Which line gives the string text a value of “Hello World”? - text = “Hello” + “ World”;
8) Like in Python, a string in Java can be represented with single quotes. - False
In Java, a text surrounded with single quotes signifies a char (or character). Only one character is allowed per char.
10) Which operator compares variables x and y? - x == y
11) Arrays are a collection of objects. Array indexes in Java starts at 0. - True
12) Declare an array of Strings x with initial values “a”, “b”, “c”? - String x[] = {“a”,“b”,“c"};
14) Which modifier describes a member that is accessible to all classes? - Public
15) Declare a private method func in Java with no return value and takes no parameters. - private void func() { }
16) A class in Java is an object “blueprint” for creating objects. What is the syntax to create a new object of class MyClass called myClass? - MyClass myClass = new MyClass();
17) A protected member is only accessible within the same class as it is declared. - False
The sentence describes a private member. A protected member is accessible within all classes in the same package and subclasses in other packages. (See "Visibility of Member Types" chart )
18) What does default do in a Java switch statement? - Handles cases not covered
19) What keyword is used to skip to the next iteration of a loop. - continue;
20) What keyword is used to exit only the loop entirely? - break;
Thanks for watching!
Don't forget to like and subscribe to Code Camp if you want to see more coding quizzes for other programming languages!
Note: This test covers version Java 8.
💬 COMMENT: How many did you get?
#Java #JavaProgramming #Coding
This Java code quiz will test you on the foundational basics of the language.
Share with those starting their programming journey!
** Java Programming Trivia Questions And Answers:
2) Which of the following is a multi-line comment in Java? - /* This is a comment */
3) This declares a string x in Java. - String x;
4) How do you create an integer with a value of 10? - int num = 10;
5) Declare a floating point variable with a value of 3.14 - float num = 3.14f;
7) Which line gives the string text a value of “Hello World”? - text = “Hello” + “ World”;
8) Like in Python, a string in Java can be represented with single quotes. - False
In Java, a text surrounded with single quotes signifies a char (or character). Only one character is allowed per char.
10) Which operator compares variables x and y? - x == y
11) Arrays are a collection of objects. Array indexes in Java starts at 0. - True
12) Declare an array of Strings x with initial values “a”, “b”, “c”? - String x[] = {“a”,“b”,“c"};
14) Which modifier describes a member that is accessible to all classes? - Public
15) Declare a private method func in Java with no return value and takes no parameters. - private void func() { }
16) A class in Java is an object “blueprint” for creating objects. What is the syntax to create a new object of class MyClass called myClass? - MyClass myClass = new MyClass();
17) A protected member is only accessible within the same class as it is declared. - False
The sentence describes a private member. A protected member is accessible within all classes in the same package and subclasses in other packages. (See "Visibility of Member Types" chart )
18) What does default do in a Java switch statement? - Handles cases not covered
19) What keyword is used to skip to the next iteration of a loop. - continue;
20) What keyword is used to exit only the loop entirely? - break;
Thanks for watching!
Don't forget to like and subscribe to Code Camp if you want to see more coding quizzes for other programming languages!
Note: This test covers version Java 8.
💬 COMMENT: How many did you get?
#Java #JavaProgramming #Coding
Комментарии