Question about Computers & Internet

1 Answer

How to declare and initialize variables in java

How the declaration of variables in java dffers from the c# declaration

Posted by on

Ad

1 Answer

  • Level 1:

    An expert who has achieved level 1.

    All-Star:

    An expert that got 10 achievements.

    MVP:

    An expert that got 5 achievements.

    Vice President:

    An expert whose answer got voted for 100 times.

  • Contributor
  • 296 Answers

Well there is not much difference there.the difference is in the data types not in declaration

Posted on Jun 08, 2009

Ad

1 Suggested Answer

6ya6ya
  • 2 Answers

SOURCE: I have freestanding Series 8 dishwasher. Lately during the filling cycle water hammer is occurring. How can this be resolved

Hi,
a 6ya expert can help you resolve that issue over the phone in a minute or two.
best thing about this new service is that you are never placed on hold and get to talk to real repairmen in the US.
the service is completely free and covers almost anything you can think of (from cars to computers, handyman, and even drones).
click here to download the app (for users in the US for now) and get all the help you need.
goodluck!

Posted on Jan 02, 2017

Ad

Add Your Answer

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

1 Answer

How to write this problem in code


const feet_per_mile = 5280
distance = 8.5
print "the distance is "+distance "+miles or+" distance*feet_per_mile+" feet."

Jul 14, 2014 | Computers & Internet

1 Answer

Can you initilise the value of a constant with the value of a variable


Whether or not you can do it depends on the programming language. In terms of best practice, it's usually frowned upon to initialize a constant using a variable.
The reason for this is that if it your value is truly a constant (e.g. pi) you'd know the value beforehand and would be able to hardcode it. Initializing a constant using a variable, implies that it's not constant and thus should be declared as a variable and not as a constant.

Mar 28, 2011 | Microsoft Computers & Internet

1 Answer

I declared a variable, but when I try to compile it it says my variable might not have been initialized. What could I be doing wrong?


You need to assign a default value to your variable, otherwise it's just declared and not initialized.
Example (in C#):
int numericValue; Here the variable numericValue has been declared as an integer
int numericValue = 11; and here the variable has been declared and initialized as an integer with the value 11.

Feb 27, 2011 | Computers & Internet

1 Answer

Why do we need to declare variables?


Hi,
I'm assuming you are referring to declaring variables in Procedural programming languages such as Java. Variables need to be declared for several different reasons, some of which include helping the computer reserve space in memory for variables to be stored and it also plays a part in the various stages of converting the source code, i.e. the code that you type in VB or Java, into machine code which is a series of binary digits that the computer can actually understand. It helps the computer in debugging the code for errors. In the first stage of code conversion, lexical analysis, information about the variable names is stored. In the next stage, Syntax analysis, the code is checked to be grammatically correct according to the rules of Backus Naur Form, i.e. if a key word such as PRINT is typed in as PLINT the computer will treat this as a variable name and since no information about this variable name has been entered in the lexical analysis stage it knows that an error has been made.
Hope this helps!

Dec 11, 2010 | Computers & Internet

1 Answer

A reference variable must be initialized at the time of declaration. when we call a function by reference then why we do not need to initialize reference variable. for example- void f(int &a) { ...


You have posted in the wrong section.
This is for computer help / operating systems.
If you post in the right section, you may get some help.
Good luck

Oct 27, 2010 | Computers & Internet

1 Answer

Says that a uncaught exception:java lang.nullpoinereException


suppose you have declared a array of 5 ( ie 0-4 ) and you are entering the value for 6 or we can say more than 5 then you will receive this error and also you have not declared the catch block or exception block for this exception to handle the error .

Oct 04, 2010 | Computers & Internet

4 Answers

Java is not working


Hello there :
first you are going to want to ensure that your your current version of java is installed correctly and is not corrupted and if it needs to be reinstalled
download the latest java version and reinstall this . www.java.com
this should be able to take care of the problem that you are having ok?
best regards michael

Aug 23, 2009 | ArcMedia JavaScript Source Code 3000 Pro...

2 Answers

Please send me the code to link two forms of a project file...actually i wanted to to transfer a variable value from one form to another...please forward code as soon as possible


if this is vb 6 then you should be able to access the other variable by using the other forms name so if you are in form1 and want to access a variable in form2

form2.variable_name

and visa versa

If this is another language then it may differ

Apr 30, 2009 | Computers & Internet

1 Answer

What specifies a variable's name and date type


I am pretty sure it is variable declaration

Oct 02, 2008 | Computers & Internet

Not finding what you are looking for?
Computers & Internet Logo

Related Topics:

70 people viewed this question

Ask a Question

Usually answered in minutes!

Top Computers & Internet Experts

Doctor PC
Doctor PC

Level 3 Expert

7733 Answers

kakima

Level 3 Expert

102366 Answers

David Payne
David Payne

Level 3 Expert

14161 Answers

Are you a Computer and Internet Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...