Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

QUESTION 6 What will happen when you compile and run the following code? 1 public class Test{ 2 3 4 public static void compute(int i,

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
QUESTION 6 What will happen when you compile and run the following code? 1 public class Test{ 2 3 4 public static void compute(int i, int i) { System.out.println("int version"); } 5 6 7 8 public void compute(int i, int i) { System.out.println("long version"): } 9 10 11 12 public static void main(String args[]) { Test t = new Test(): compute(10, 5); } 13 14 15 } int Version O long Version Compilation Error Runtime Error QUESTION 7 What is a constructor? O another name for an instance variable o the return type of method o the method that creates an object, or instance of the class o the instantiation of an object QUESTION 8 What does it mean when a method is static? o it modifies or mutates an object o it applies to the entire class, not just one object or instance o it is private o it is overloaded QUESTION 9 means the method has no return value. Ovoid O static String concatenation o QUESTION 10 Which of the following is true about private access modifier ? o Variables, methods and constructors which are declared private can be accessed only by the members of the same class Variables, methods and constructors which are declared private can be accessed by any class lying in same package Variables, methods and constructors which are declared private in the superclass can be accessed only by its child class None of the above QUESTION 12 What is an object? o Instance of an object o Instance of a method Instance of a class o Instance of constructor QUESTION 13 Which constructor has no parameters? Default Constructor o Null Constructor Parametric constructor O Copy Constructor QUESTION 14 In oops public, private & protected are Classes O Access Modifiers o Interfaces O Method Signature

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning ASP.NET 2.0 And Databases

Authors: John Kauffman, Bradley Millington

1st Edition

0471781347, 978-0471781349

More Books

Students also viewed these Databases questions