1. What is the result of executing the following code? int x,a=2,b=3,c=4; x=++a+b+++c++;
This equates to x= (++a) +b+c; b++;c++ | Post + + After the end of the operation, Pre + + before the operation to perform | So the result is x=10 a=3 b=4 c=5
2. Which of the following expressions is correct?
A String s= "Hello"; int i=3; S+=i;
B String s= "Hello"; int i=3; if (i==s) {s+=i};
C String s= "Hello"; int i=3; S=i+s;
D String s= "Hello"; int i=3; s=i+;
E. String S=null; Inti= (s!=null) && (s.length>0)? S.length (): 0;
AE a:s+=i; Convert S=i+s to type before performing the + = operation; So the A-expression is correct C-error is more than string, and so are other different types of operations
3 string[] s=newstring[10];
S.length () = 10; Default value of s[0]...s[9] is null;
4 Interface Name Xxx=new interface an implementation class (). This facilitates
1. Easy to standardize the design of the program
2. Work with the team to develop
3. Easy to convert to components
4. Convenient code reuse, no need to know the technical details.