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
Marta_Voda [28]
3 years ago
10

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

riable of that class? What happens to the static variables of a class once the class has no instances?
Computers and Technology
1 answer:
9966 [12]3 years ago
4 0

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

 */

}

You might be interested in
What type of software is responsible for managing processor time and memory allocation?
yKpoI14uk [10]

Answer: Operating system

Explanation:

 The operating system is the type of software that are responsible for manage the processor time and also the memory allocation in the system. The operating system mainly deals with the processor time by scheduling the processor work done in the system.

The OS mainly control the system and then schedule the execution of various types of function by the central processing system (CPU). It also control the memory allocation in the system.

4 0
3 years ago
Explain the unique reason why assember language is perfered to high level language
Zigmanuir [339]

The unique reason why assembler language is preferred to high level language is that  It is said to be memory efficient and it is one that requires less memory.

<h3>Why is assembly language better than other kinds of high level?</h3>

It implies means that the programs that one uses to write via the use of high-level languages can be run easily on any processor that is known to be independent of its type.

Note that it is one that has a lot of  better accuracy and an assembly language is one that carries out a lot of better functions than any high-level language, in all.

Note also that the advantages of assembly language over high-level language is in terms of its Performance and accuracy as it is better than high-level language.

Hence, The unique reason why assembler language is preferred to high level language is that  It is said to be memory efficient and it is one that requires less memory.

Learn more about assembler language from

brainly.com/question/13171889

#SPJ1

3 0
2 years ago
Is designed to access a computer or operating system without the knowledge or permission of the user.
kramer

Answer:

Spyware

Explanation:

Spyware is a type of program that is installed with or without your permission on your personal computers to collect information about users, their computer or browsing habits tracks each and everything that you do without your knowledge and send it to remote user.

5 0
2 years ago
4. Assuming that social networking at the resorts will require wireless communication and connection to the Internet, what are s
Studentka2010 [4]

Answer:

Social networking capabilities could be made available by the presence of SBRUs central servers and local resort's server. For resorts that are using SBRU servers, there will be high bandwidth access to the internet. This can create a service level of 100% availability. However, for the resorts with high usage clients, a local server could be provided. Similar support will be needed and it will encourage local communication. The possible issues will be problems of connectivity, reliability as well as bandwidth.

Explanation:

Social networking capabilities could be made available by the presence of SBRUs central servers and local resort's server. For resorts that are using SBRU servers, there will be high bandwidth access to the internet. This can create a service level of 100% availability. However, for the resorts with high usage clients, a local server could be provided. Similar support will be needed and it will encourage local communication. The possible issues will be problems of connectivity, reliability as well as bandwidth.

8 0
3 years ago
________ speeds time to insights and enables better data governance by performing data integration and analytic functions inside
Lyrx [107]
<h3><em>↓Answer↓</em></h3>

<u>In-database analytics</u> speeds time to insights and enables better data governance by performing data integration and analytic functions inside the database.

3 0
2 years ago
Other questions:
  • When you are shopping online and finalizing your order, you usually fill in forms for your name, address, email, and payment met
    6·1 answer
  • If you don't know whether to write too, two, or to, you should use the spell-checker to help you decide. true or false?
    7·1 answer
  • Implement the function pairSum that takes as parameters a list of distinct integers and a target value n and prints the indices
    11·1 answer
  • Write a program to convert a fraction to a decimal. Have your program ask for the numerator first, then the denominator. Make su
    10·1 answer
  • Which do switches create?<br> Networks<br> Wireless access points<br> Routes<br> Collision domains
    13·1 answer
  • What is the first thing you should do to find a mean and range of data?
    14·1 answer
  • If i hit the delete key three times what will be left
    12·1 answer
  • Write a C program that uses a while statement to determine and print the largest of 10 numbers input by the user. Your program s
    6·1 answer
  • A good machine should have the mechanical advantage of......?​
    7·1 answer
  • Configuring a firewall to ignore all incoming packets that request access to a specific port is known as ____.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!