Answered step by step
Verified Expert Solution
Question
1 Approved Answer
hello chegg expert please it's urgent and very very important for me please help me and give me the answers of all the questions I
hello chegg expert please it's urgent and very very important for me please help me and give me the answers of all the questions I don't have enough time please please
1. In the following keywords, which one can be used to create an instance of one class ( ) A Class BNew CPrivate D void 2. Which of the following identifiers is incorrect? ( ) A testjava_1 B Snumberjava C1_numberjava D startTimeJava 3. What is the output of the following program fragment?? ( ) int a=2; int b=2; if (a==b) System.out.println("a="+a); A a=2 B a=0 C Compile error and cannot run DNormal operation but no output 4. Assume that a method will generate a non-RuntimeException. If you want to hand the exception to the method that called the method, what is the correct way to declare? ( A throw Exception B throws Exception 5. Which definition is wrong? ( ) A float x( int a, int b) { return ab; Bint x( int a, int b){ return ab;} Cint x (int a, int b); \{return ab; } Dint x (int a, int b) { return 1.2 * (a+b);} 6. After executing String [] s= new String [9]; which of the following conclusions are correct ( ) As[8] is" " B s[8] is null C s[0] is undefined D None of them 7. Which of the following statements about interfaces in Java is true? ( ) AThe interface contains the implementation method of the specific method BIf a class implements an interface, the "implements" keyword is used CIf a class implements an interface, the "extends" keyword is used DInterface does not allow inheritance 8. Indicate which of the following methods are unreasonable overload methods of public void overload(int x, int y){}. ( ) A, public long overload (long x, long y){} B public float overload (float x, float y ) \{\} C public void overload (int x){} D public int overload (int a, int b)\{\} 9. The value of the Expression: (x>y)?(z>w)?x:z:w, ( where x=5,y=9,z=1,w=9) is: A 5 B 8 C 1 D9 10. A class has a method with no formal parameters and no return value. Other classes can call it with the class name A as the prefix. The method header is written as ( ) A static void method() B public void method() C final void method() Dabstract void method() 11. Which of the following options defines a valid abstract class? () A abstract Shape { abstract void area(); } B class abstract Shape { abstract void area(); } C abstract class Shape { abstract void area(); } D abstract class Shape { abstract void area() \{\}} 12. The result of "Harbison".substring(3) is ( ) AHar B son Crbison D bison 13. When a new class is defined, which keyword is impossible to used( ) A protected B class C extended D public 14. Integer data type that require the least memory space are ( ) A short B long c. int D byte 15. Which of the following import commands allows us to create input / output stream objects in our program ( ) A import java.sql.*; Bimport java.util.*; C import java.io.*; D import java.net.*
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started