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
Meaning of 'WSAD" iiiiii
Anit [1.1K]

Answer:

Websphere Studio Application Developer

7 0
3 years ago
Read 2 more answers
If you enter 234.567 into a cell that is formatted to display 1 decimal point place, what is the value stored in the cell
zalisa [80]

IT WILL NOT BE 234.6 FOR PF GANG JUST TOOK THE TEST

6 0
3 years ago
I have a computer teacher who made me lose points in an assignment and saying that the reference page should be on a separate pa
lukranit [14]

Answer:

Have a talk with your teacher. Ask why she doesn't believe you, and if it still doesn't work, have a talk with someone that can physically help you - a principle or another teacher may be the best solution.

4 0
3 years ago
Where is the spell checker found in excel?
fenix001 [56]
Except keyboard of F7 and Spell Checkbutton in toolbar, you are also able to apply Spelling check command fromExcel 2007/2010/2013/2016 Ribbon: Click the Review tab; Go to Proofing group; Then you will view the Spellingbutton , that's Spell Check command.



hope this helps
5 0
3 years ago
Read 2 more answers
The Windows Operating System: A) is a web-based operating system for the Internet era. B) is a data management application used
NNADVOKAT [17]

The Windows Operating System is an operating system used on most Wintel PCs throughout the world.

E) is an operating system used on most Wintel PCs throughout the world.

<u>Explanation:</u>

An operating system can be defined as a system software whose main function is to act as an interface between the user and the computer.  It performs different administrative elements of a PC and gives a graphical UI to the client with the goal that they can impart to the PC.  

Wintel is a PC exchange industry term for PCs dependent on the Intel chip and one of the Windows working frameworks from Microsoft. In the zone of work area and smart phones, Windows is commonly above 70% in many markets and at 78% all inclusive, Apple's macOS at around 14%, Google's ChromeOS at about 3% (in North America) and Linux at around 2%.  

The term Wintel PCs originate from the mix of two words: Windows and Intel, which allude to the PCs that work on the Windows Operating System and use Intel Processors.

6 0
3 years ago
Other questions:
  • Select all examples of proper keyboarding technique.
    15·2 answers
  • A _____________ is a method of controlled entry into a facility and provides access to secure areas such as a research lab or da
    10·1 answer
  • Write a class named Car that has the following member variables: - yearModel. An int that holds the car’s year model. - make. A
    6·1 answer
  • How do you do these two questions? The first might have multiple answers and the second will have only one answer.
    14·1 answer
  • Henry must choose which type of smart speaker to use in his home. He asked you to help him decide which one will best suit his n
    11·1 answer
  • Which technique helps you look confident as a speaker?
    15·1 answer
  • The 7-bit ASCII code for the character ‘&amp;’ is: 0100110 An odd parity check bit is now added to this code so 8 bits are trans
    12·1 answer
  • He made me so angry when he didn’t let me make my point that I had to stalk after him.
    5·2 answers
  • In what way , if any, can your social media presence affect your chances of getting a job in social media?
    8·1 answer
  • Question 3 10 points Save Answer Many companies in the computer industry introduce new products and services frequently in an at
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!