[Daily Java interview on Ten] (c)

1. Which of the following is the correct definition of variables ()

A int 1abc;

B char abc1;

C long #abc;

D boolean $abc;

E String_123456asdfghjklqwertyuiopzmnbvasdf12345;

2.public class Test {
    public final String a;
        public Test() {
            a = "10";
        }
    public void setA1(){
               a = "20";
        }
     public static void main(String[] args) {
            Test t = new Test();
            t.setA1();
            System.out.println(t.a);
        }

}

value ta ()


A      “10”

B      “20”

C      “”

D None of the above, and compilation errors.


3.  double a = 15.0;

      int b=2;
      system.out.println(a+b);

Numeric type printed is ()

A int

B float

C String

D double



4. The scope to private element is modified?

A. The current class

B. within the same package

C. descendant class

D. Other in package


5.String s = new String ( "xyz"); phrase altogether created several String Object? 

A. 1

B. 2

C. 3

D. 4

    

6.String is the most basic data type? ()

A, is

B, not


7. Interface is one of Java's object-oriented implementation mechanism, the following statement is correct

A: Java support multiple inheritance, a class can implement multiple interfaces;

B: Java support only single inheritance, a class can implement multiple interfaces;

C: Java supports only single inheritance, a class can only implement an interface;

D: Java support multiple inheritance, but a class can only implement an interface


8. In Java, a class can be defined in many of the same name at the same method, the number of formal parameters, type, or the order of different methods, the return value may not be the same. Such properties of the object-oriented program is called

A: Hide

B: covering

C: Overloaded

(B) the answers to the public have shared a number? Wise you get a few right? If you still do not understand the Department please leave a comment below, small series we will answer your questions at the first time! , We can look to see the answer

D: Java does not support this feature

Published 14 original articles · won praise 4 · Views 7452

Guess you like

Origin blog.csdn.net/duchaochen/article/details/79487337