answersLogoWhite

0

Yes. You can have as many variables as you want in Java

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

Why we write java program using classes?

Classes are well organised functions in java which help discriminate between two different functions.


How you make shared and synchronized variable in java thread?

A Variable that is shared as well as synchronized cannot be created in Java. These two terms are mutually exclusive and a variable that is synchronized in java cannot be shared and vice versa


How do you write java program to times a number?

Java, like many other programming languages, uses the asterisk for the multiplication operator. Therefore, two numbers a and b are multiplied, and their product assigned to a variable r, with this construct: r = a * b;


Can you interchange the term public and static in java?

The two are different, and independent from one another. A variable can be public, static, both public and static, or neither.


Difference between equals equals and equal in java?

"==" in java is the binary operator which compares two values and gives a boolean result While "=" in java is a assignment operator which assigns a value to a variable.


What is the difference between Java bean and bean?

JAVA beans and coffee beans are two very different things . JAVA beans are used to generate getters and setters. while coffee beans are use to make coffee.


What are two main purposes of the Java compiler javac?

One of them is creating *.class from *.javaSecond is identifying syntax errors in the *.java files and intimating the programmer so that he can correct them


Write a menu driven program in java to find area of different shapes. 1. Circle 2. Triangle 3. Rectangle?

Remember that the area of a rectangle is width * height: static int getArea(Rectangle r) { return r.width * r.height; }


What is classpath and path in java?

if you are using the IDE then there is no need to set class path, ant you are using Command prompt to run the java program then you need to set the class path where the class (which is going to be used in your program) is actually located,use the following command:set calsspath=%classpath%;actual_path_of the class;we cancall more than two class by using this command by using separator (,)


When class definition not found error will occur?

This error occurs when you try to run a java program and the JVM (java virtual machine ) do not found the class file for your program. there are two reasons for this kind of error to occur 1. If you haven't set the CLASSPATH environment variable for the bin directory of your java installation or to the current directory in which you are working, then JVM will never know where to look for the class files you are trying to load and so the error occurs. 2. you may be trying to run your program with a wrong class name which doesn't exist. note: this error doesn't mean that there is any error in your code.


What is different between equals equals and equals method in java?

== (the double equal sign) is used to compare two values (resulting in true if they are equal, false otherwise). = (a single equal sign) is used to assign a value to a variable.


What is the program for compare two strings using conditional operator in java?

System.out.println(a.equals(b) ? "They are equal" : "They are different");System.out.println(a.equals(b) ? "They are equal" : "They are different");System.out.println(a.equals(b) ? "They are equal" : "They are different");System.out.println(a.equals(b) ? "They are equal" : "They are different");