- 8

plz snd me the ansewr

Section 1 Quiz (Answer all questions in this section) 1. Which statement is true when run the following statement? 1. String str = null; 2. if ((str != null) && (str.length() > 1)) { 3. System.out.println("great that number 1"); 4. } else if ((str != null) & (str.length() < 2)) { 5. System.out.println("less than number 2"); 6. } Mark for Review (1) Points The code compiles and will throw an exception at line 3. The code compiles and will throw an exception at line 5 The code compiles and will throw an exception at line 4. The code compiles and will throw an exception at line 2. The code does not compile. 2. Which of the following operators are logic operators?(Choose Two) Mark for Review (1) Points (Choose all correct answers) ! = && <= > 3. When you instantiate a subclass, the superclass constructor will be also invoked. True or False? Mark for Review (1) Points True False 4. Which two statements best describe data encapsulation? (Choose Two) Mark for Review (1) Points (Choose all correct answers) The access modifier for methods is protected. Member data can be modified directly. The access modifier to member data is private. Methods provide for access and modification of data. 5. What is the output from the following code snippet? int i=0,j=0; i=++i; j=i++; System.out.println("i=" + i + " " + "j=" + j); Mark for Review (1) Points The code will compile and print "i=2 j=2" The code will compile and print "i=1 j=2" The code will compile and print "i=2 j=1" The code will compile and print "i=1 j=1" The code does not compile.

25th Feb 2018, 3:15 AM
ROSHAN SHETTY
ROSHAN SHETTY - avatar
1 Antwort
+ 2
At SoloLearn, we don't want to do your homework. At least try it yourself.
25th Feb 2018, 6:07 AM
LunarCoffee
LunarCoffee - avatar