answersLogoWhite

0

What is a field in java?

Updated: 10/31/2022
User Avatar

Wiki User

12y ago

Best Answer

A field is an attribute. A field may be a class's variable, an object's variable, an object's method's variable, or a parameter of a function.

class bike{ static int bikes;int gear;int cadence;

void create( int newGear, int newCadence ){bikes = bikes + 1;gear = newGear;

cadence = newCadence;}

int getSpeed(){int speed = gear*cadence*5*3.141;return speed;}}

'bikes' is a class's variable (class variable) (static field).

'gear' and 'cadence' could be an object's variables (instance variables) (non-static fields).

'speed' is an object's method's variable (local variable).

'newGear' and 'newCadence' are parameters of a function (parameters).

Refer to related links section

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is a field in java?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you find max value out of anonymous array in java?

java is very most important language in computer field. .net is also useful


Which type of languages is need in software field?

PHP, C#, JAVA etc


Which are the new technologies in software field?

java is the new technology and widely used


Is there an job opportunity after learning java?

There are a lot of jobs available in the Java Programming field. You might want to go to http://www.dice.com and search for JAVA jobs in your area. I'm sure you can find entry level Java developer positions if you look!


What is instance variable in java?

That refers to a variable attached to an object - also known as a field.


Where can you find employment connected to writing java programs in the UK?

One can find freelancing jobs in the Java writing field on the Freelancer website. One can also visit the CWJobs and the Jobsite websites to find Java related jobs in the UK.


How does a person obtain information about collections in Java?

You can obtain information about collections in Java online at the Java section of the Oracle Docs website. Alternatively, you can also find this information at the Wikipedia. Once on the website, type "Java collections framework" into the search field at the top of the page and press enter to bring up the information.


How do you you Create 2 text-field and 1 button in java using applet and then get the input as integers in 2 text-field and to display the output in label already created when you click the button?

How to you Create 2 text-field and 1 button in java using applet and then get the input as integers in 2 text-field and to display the output in label already created when you click the button? please send immediately,needed urgently


When creating a field for a persons name what would be an appropriate data type to choose for that field?

In Java, that would most likely be a String. In other programming languages, use whatever equivalent the language supports.


What Indonesian island is Jakarta on?

java


Does Visual Java plus plus and Java Builder is different from the Java language?

Yes!Visual Java plus plus and Java Builder is different from the Java language?


What are the different java technologies?

There are several types of Java technology. Some examples of Java software are Java ME, Java EE, Java SE, and Java Card. Java made the JAVA development kit for those that develop in Java. There is also Java Virtual machine and some class libraries. Java is also famous for its languages like Clojure, Beanshell, Groovy, Gosu, Rhino, Kotlin, JRuby, Scala, and Jython.