The Artima Developer Community
Sponsored Link

Java Answers Forum
no value in table...

1 reply on 1 page. Most recent reply: Oct 6, 2002 1:07 PM by knut n

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
knut n

Posts: 2
Nickname: enemigo
Registered: Oct, 2002

no value in table... Posted: Oct 6, 2002 12:39 PM
Reply to this message Reply
Advertisement
Hi

I'm working on a javapgr. now, it's a school assignment. The program reads values between 0 and 9 into a table with lenght=10. I enter values and the table registers "1" for each time it's value is entered. My problem is that I don't want the program to print the result for a table if it's number wasn't entered.

tabHeltall is the name of the table, I thought I could check if the table was empty by checking if it was zero, and then just print a blank space in "else". But that din't work.
--------
for(int indeks = 0; indeks < tabHeltall.length; indeks++){
if (tabHeltall = 0){
System.out.print(" ");
}
else {
---------

So what I really want to know is what to write to check if a slot in a table is empty. Or should I say, if a slot has not been written a value into.

Hope I expressed myself properly.

Thnx Knut


knut n

Posts: 2
Nickname: enemigo
Registered: Oct, 2002

Re: no value in table... Posted: Oct 6, 2002 1:07 PM
Reply to this message Reply
solved it!

for(int indeks = 0; indeks < tabHeltall.length; indeks++){
if (tabHeltall[indeks] < 1){
System.out.print("");
}

Flat View: This topic has 1 reply on 1 page
Topic: Question in Inheritance Previous Topic   Next Topic Topic: awt/swing and file (URGENT)

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use