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 on P9unlike most common programming languages, instead of compiling the source code into machine code or interpreting source code when running, java is designed to compile the source code into bytecode, then bytecode will be run by the runtime environment. . to help you better understand this programming language, the following quiz of network administrator will give you lots of useful knowledge.
- Get familiar with NetBeans Java IDEin the following article, we will introduce you the most basic features of netbeans ide through a small test, which is to create the 'hello world' java application. and when finished, you will know the general knowledge and process when programming applications in ide ...
- Testing test on JAVA P2multiple choice questions on java programming help you test your basic knowledge of this programming language. the set of questions includes 10 sentences to try.
- JAVA P8 test quizif you are interested in learning about the java programming language, the following quiz of network administrator will provide you with a lot of useful knowledge for your learning.
- Basic Java syntaxa java program can be defined as a collection of objects, communicating through calling each other's procedures. now we will look at the class, object, procedure and instance variable / instance variable to consider their meaning.
- eQuiz - Multiple choice test on Java Swing Practicewelcome to the test series of tipsmake.com with topics related to the fields of information technology. and this time we will continue with the java swing practice test, a total of 13 questions will be answered with no time to answer each sentence. there will be some questions with many different answer options
- What is JAVA file? How to open, edit and convert JAVA filesa file with a .java extension is (or sometimes also used in .jav format) is a java source file written in the java programming language.
- eQuiz - Multiple choice quiz about JAVAfollowing are multiple-choice questions related to java programming language, there will be 23 questions in total with no answer for each time. let's get started!
- Download and install Java on the computerto program java on your computer, you need to install the java environment, this tutorial will show you how to download and install java on your computer.
- Basic Java exercises, with sample decodingto serve your java learning needs, tipsmake.com has synthesized some java exercises from many sources, including sample code (for some articles). hopefully it can be helpful to learn your java programming language.