JAVA test on P4
- Question 1. How much does the following block have?
String greeting = 'Hello';
int k = greeting.length ();
System.out.print (k);- 4
- 5
- 6
- 7
-
- Question 2. What effect does str.charat (n) command do?
- Get any character in string str
- Get the string length str
- Get the character with the index number n in the string k
- There is no such command
-
- Question 3. How much is the following block of code when executing?
char [] greet = new char [10];
greet = 'Hello';
k = greet.length ();
System.out.print (k);- 4
- 5
- 6
- Compilation error
-
- Question 4. In the following special types of real numbers, which type is correct?
- Ocean infinity
- Infinity
- NaN
- All 3 values above
-
- Question 5. In Java, what type of char represents the code set below?
- UTF-8
- UTF-16
- UTF-32
- All the above code
-
- Question 6. The default value of a variable of type char is?
- u0000
- uFFFF
- OF
- OX
-
- Question 7. What are the following two statements?
String greetings = 'Hello';
String s = greetings.substring (0.3);- Hell
- Hel
- ello
- Hello
-
- Question 8. What are the following two statements?
String greetings = 'Hello'
String s = greetings.substring (0.3);- Hell
- Hel
- Wrong command
- Hello
-
- Question 9. In the following two statements, what does the substring command do?
String greetings = 'Hello';
String s = greetings.substring (0.3);-
Retrieve the characters from index 0 position to index position 2 of the greetings string and put into s
-
- Change the first 3 characters of the greetings string
- Copy the string greetings into the string s
- Cut characters from position index 0 to index 3 and input s
-
- Question 10. What is enum type?
- A data type consisting of fields containing a fixed set of constants
-
- Is the data type that lists variables
-
Is a data type in java
- All is wrong
-
- Question 11. How many types of access are there in JAVA?
- first
- 2
- 3
- 4
-
- Question 12. If you do not declare the keyword indicating the scope of access, what is the scope of access of the object?
- Can access from classes in the same package
- You can access objects from classes in the same package and subclasses in other packages
-
Can access objects from other methods in that class
-
- Can access the object from any location of the program
-
- Question 13. What is the access scope of an object when declared private?
-
Can be accessed anywhere in the program.
-
- Can be accessed from classes in the same package.
-
Can be accessed from classes in the same package and subclasses in other packages
-
Only accessible from other methods in that class
-
- Question 14. What is an object's access scope when declared protected?
-
- Can be accessed from any location in the program.
-
- Can be accessed from classes in the same package.
-
- Can be accessed from classes in the same package and subclasses in other packages.
-
- Only accessible from other methods in that class.
-
- Question 15. What is the access scope of an object when public declaration is made?
-
- Can be accessed from any location in the program.
-
- Can be accessed from classes in the same package.
-
- Can be accessed from classes in the same package and subclasses in other packages.
-
- Only accessible from other methods in that class.
-
5 ★ | 1 Vote
You should read it
May be interested
- Test on JAVA test P5do you like java programming and want to learn useful knowledge to apply to work? to meet the needs of readers, network administrators have collected and sent a series of quiz questions about java programming. invite your reference.
- P13 programming set of multiple choice questionsyou are a fan of programming languages and want to learn more about this topic. to give you an interesting reading about programming, in this article, the network administrator will send you a good quiz about this topic. invite your reference.
- What test you know about operating system P11please read your knowledge and the following multiple choice questions of network administrator. hope with these questions will give you lots of useful information.
- Are you confident with your Network Administration knowledge P6please read our below knowledge and network admin questions. the question set will have 12 sentences for you to try.
- Multiple choice questions about Photoshop P17in addition to mastering the skills, you also need to supplement yourself with useful knowledge when working with photoshop. in the quiz below, join the network administrator and learn and play with the following interesting questions.
- JAVA test on P6multiple choice questions about java programming give you useful knowledge. if you love java programming, don't skip the series of interesting tests below by network administrator.