1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
den301095 [7]
3 years ago
6

Which of the following is used to allocate memory for the instance variables of an object of a class?1. the reserved word public

Computers and Technology
1 answer:
kodGreya [7K]3 years ago
3 0

Answer:

The correct answer to the following question will be 2. the operator new.

Explanation:

New operator is used to allocating the memory to the instance object.The new object can be created by using a "new" keyword in java .

Syntax of using 'new' operator is :

class_name object_name=new class_name() // it allocated the memory to the class

For Example :

ABC obj = new ABC;  

Now, this time obj points to the object of the ABC class.

obj = new ABC ();

call the construction of ABC class

You might be interested in
This isn't about school but every time it tells me to watch an ad to unlock the answer to a question it prompts a survey and it
Masja [62]
Restart it than see what happens
4 0
3 years ago
Read 2 more answers
Call of duty vanguard, war zone , fornite, gta what’s your favorite
tia_tia [17]
Warzone easily but gta a close second
8 0
3 years ago
Instructions: Use the tables below to answer the questions that follow:
Svet_ta [14]

Answer:

same as above....................

3 0
3 years ago
What is SEO?<br> Training Live Online Instructor-Led Learning, https://www.peoplentech.com.bd/<br> ,
evablogger [386]

Answer:Search engine optimization (SEO) is the process of optimizing your online content so that a search engine likes to show it as a top result for searches of a certain keyword. ... When it comes to SEO, there's you, the search engine, and the searcher.

Explanation:

4 0
3 years ago
How are static variables and methods created in Java? What happens if a non-static method of a class tries to access a static va
9966 [12]

Answer:

Static variables are the variables decaraed with keyword static, static variables must be deacraled inside the class body, means we can not declare a static variable inside a method or consttructor, static variable belongs to class, for a class only one copy is created for static variable and used by all the objects/instances.

Static variable can access with class name like

X.i

Static method are the methods defined with static keyword, static method are also part of a class, we can access static meethod using class name like

X.printI()  

Explanation:

class X

{

//to create a static variable we need use static keyword with variable name like

public static int i;

// to create a static method we need to use static keyword while defining a method like

public static void printHello() {

 System.out.println("Hello");

}

/*

 * A non static method can access static variable of a class there is no issue

 * with that we can use a static variable in a non static method like

 */

public void printI() {

 System.out.println(i);

}

/*

 * As long as the class exist in JVM static variables will be there, as static

 * variable belong to class not with the instance,

 * it does not matters if there are instance exist or not

 */

}

4 0
3 years ago
Other questions:
  • Define the method object inc_num_kids() for personinfo. inc_num_kids increments the member data num_kids. sample output for the
    11·1 answer
  • You have a folder on your Windows desktop system that you would like to share with members of your development team. Users need
    13·1 answer
  • In which situation will file compression be required to complete the task
    15·1 answer
  • When programming in Scratch, to make our Sprite walk across the background, in which category would we find the programming bloc
    7·1 answer
  • Write a brief one parapragh summary describing the financial reality of the American family.
    10·1 answer
  • Traffic collisions are among the top killers of children in America.
    13·1 answer
  • Assume you are given three variables, revenue, expenses, and profit, all of type Money (a structured type with two int fields, d
    10·1 answer
  • Question 6 Which of the following statements about datasets used in Machine Learning is NOT true? 1 point Testing data is data t
    8·1 answer
  • (Reverse number) Write a program that prompts the user to enter a four-digit inte- ger and displays the number in reverse order.
    9·1 answer
  • Explain the consequences of using bits to represent data.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!