answersLogoWhite

0

public class Test {

int i = 0;

double d = 0;

char c = 'A';

boolean val = true;

String str = "Rocky";

.......

......

.....

}

User Avatar

Wiki User

16y ago

What else can I help you with?

Related Questions

Does HTML allow you to declare integer real string and boolean variables?

HTML is not a programming language and as such does not allow you to declare variables.


Is it possible to initialize null character in string?

yes we can initialize null characterfor example syntax :string='\0';


How do you get boolean value from string in java?

Here is some sample code to convert a string into a boolean: String word = "true"; boolean boo; if (word.equalsIgnoreCase("true")) boo=true; else boo=false;


What is the simularities of parameter and arguments?

Arguments are fields that are given to a method when it is called, while parameters are the name for the received variables. For example:public static void main(String[] args){int arg1 = 0;boolean arg2 = false;String arg3 = "Some string";function_a(arg1, arg2, arg3);// These variables are called arguments because they are being passed// to the function.}public static void function_a(int par1, boolean par2, String par3){// These variables are called parameters because they are being received// when the function is called.}I hope this helps.


Can you store non primitive data type in the array list?

Yes you can store non primitive data type variables in an array. String is a non primitive data type. You can declare a string array as: String a[]=new String[10];


How do you declare a string?

prefix with a """string()""


Can you compare a boolean to an integer?

no, you cant. it only works on string


Where string is primitive data type of string data type?

String is not primitive data. Only char,int,double,and boolean are!


What is the difference between functions and variables?

Variables define a certain value, such as an integer, string, boolean value, etc. Functions are defined to run a certain task, and may or may not return a value. You can have a function that calculates the sum of two numbers and returns the sum once calculated.


What is the prefix for variable?

In programming, the term "prefix" typically refers to a naming convention that precedes the name of a variable. Common prefixes include "int" for integer variables, "str" for string variables, "bool" for boolean variables, and so on. These prefixes help developers quickly identify the data type of a variable.


How many constructors does the StringTokenizer class have?

As of Java 1.6 it has 3: StringTokenizer(String str) StringTokenizer(String str, String delim) StringTokenizer(String str, String delim, boolean returnDelims)


How can Boolean be used in Java?

An expression is anything that can be evaluated ("calculated"), to get a value. Numeric expressions are more common: anything that you can calculate, and get a number. For example, if a and b are numbers, a + b will give you another number - it is therefore a numeric expression. The variables by themselves are also numeric expressions.A boolean expression is anything that you can evaluate and get a result that is boolean, i.e., either true or false. Here are some examples:a == ba > ba >= 5 && a ba >= 5 && a ba >= 5 && a ba >= 5 && a