Which of these is used to access a member of class before object of that class is created

Which of these is used to access a member of class before object of that class is created
Which of these is used to access a member of class before object of that class is created
DownloadApp

  • Academic Resource

    Aptitude Data Interpretation Verbal Reasoning Non Verbal Reasoning Verbal Ability Programming General Knowledge Puzzle

  • Engineering

    Computer Engineering Electronics and Communication Electrical Engineering Mechanical Engineering Civil Engineering Biotechnology Architecture & Planning

  • Online Test

    Aptitude Test Data Interpretation Test Verbal Reasoning Test Non Verbal Reasoning Test Verbal Ability Test

  • Exams
  • More

    Full Forms हिंदी


Home » JAVA Programming » Modifier Types » Question


Modifier Types

Easy Questions

JAVA Programming

Java Basic

Basic Syntax

Object & Classes

Basic Datatypes

Variable Types

Modifier Types

Basic Operators

Loop Control

Decision Making

Numbers

Characters

Strings

Arrays

Date & Time

Regular Expressions

Methods

Files and I/O

Exceptions

Inheritance

Polymorphism

Abstraction

Encapsulation

Interfaces

Packages

Data Structures

Collections

Generics

Serialization

Networking

Multithreading

Applet

  1. Which of these is used to access member of class before object of that class is created?

    1. public
    2. static
    3. protected
    4. private
    5. None of these

Correct Option: B

static

Which of these is used to access a member of class before object of that class is created


Your comments will be displayed only after manual approval.

2. Which of these is used to access member of class before object of that class is created?a) publicb) privatec) staticd) protectedAnswer: cExplanation: None.View Answer

3. Which of these is used as default for a member of a class if no access specifier is used for it?View Answer

4. What is the process by which we can control what parts of a program can access the members of aclass?View Answer

Explanation: None.5. Which of the following statements are incorrect?View Answer

6. What is the output of this program?1.classaccess2.3.publicintx4.privateinty5.voidcal(inta,intb6.7.x=a+8.y={;;){1;b;

9.}10.}11.classaccess_specifier12.{13.publicstaticvoidmain(Stringargs[])14.{15.access obj=newaccess();16.obj.cal(2,3);17.System.out.println(obj.x+" "+obj.y);18.}19.}a) 3 3b) 2 3c) Runtime Errord) Compilation ErrorView AnswerAnswer: cExplanation: None.output:$ javac access_specifier.javaException in thread “main” java.lang.Error: Unresolved compilation problem:The field access.y is not visible

7. What is the output of this program?{;;)

6.{7.x=a+1;8.y=b;9.}10.voidprint()11.{12.system.out.println(" "+y);13.}14.}15.classaccess_specifier16.{17.publicstaticvoidmain(Stringargs[])18.{

19.access obj=newaccess()20.obj.cal(2,3)21.System.out.println(obj.x)22.obj.print()23.24.;;;;}}View Answer

8. What is the output of this program?{;;)

6.{7.x=a+b;8.y=x+b;9.}10.}11.classstatic_use12.{13.publicstaticvoidmain(Stringargs[])14.{15.static_out obj1=newstatic_out();16.static_out obj2=newstatic_out();17.inta=2;18.obj1.add(a, a+1);19.obj2.add(5, a);20.System.out.println(obj1.x+" "+obj2.y);21.}22.}

a) 7 7b) 6 6c) 7 9d) 9 7View Answer

Is used to access a member of class before object of that class is created?

If no access specifier is used then by default member is public within its own package & cannot be accessed by Java run time system. 2. Which of these is used to access a member of class before object of that class is created? Explanation: None.

Which is used to access the member of a class?

Dot (.) operator is known as "Class Member Access Operator" in C++ programming language, it is used to access public members of a class.

Which of these is used to access a member of class without creating object?

Non-static methods can access any static method and static variable, without creating an instance of the object.

Which of the following access control modifier is used to access a member of class before the object of that class is created?

Explanation: By definition if a class has no access specifiers, it defaults to private accessibility. 2. Which of these is used to access members of class before the object of that class is created? Explanation: None.