Java Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesJava Help

Closed Thread
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 15th, 2005, 06:22 AM
Calaen Calaen is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2005
Posts: 19 Calaen User rank is Corporal (100 - 500 Reputation Level)Calaen User rank is Corporal (100 - 500 Reputation Level)Calaen User rank is Corporal (100 - 500 Reputation Level)Calaen User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 5 h 35 m 15 sec
Reputation Power: 0
Java basic program guidance

Having some problems taking in the Java at Uni,

Was wondering if anyone could shine some light on it for me.

My task is to write a program that will ask you to enter 2 words. the program will then print out both words on one line. However the words will be seperated by dots that will make the total length of the line 40. so if your first word was turtle and the second was abc, the output would be

turtle...............................abc

The program should check for certain conditions:

1. a word can not be longer than 37 characters;
2. there must always be atlest 2 dots in a line.

The program should ask for the first word till a word of acceptable length is entered. it then does the same for the second word.

once both words are input the prgram will either output an error message if the words are to long when combined;

or output the required line with words.

I have to write the program using while and/or do-while loops

It also says something about the length of a string can be found out using myString.length().

I can understand the basic of what I need to do but with regards to word length and adding the required number of dots im fooked.

Any pointers would be appreciated.

Cheers.




Quote:
Moderator's note: Read at least until the second page for best info

Last edited by Nemi : November 17th, 2005 at 10:46 AM. Reason: Added comment

Reply With Quote
  #2  
Old November 15th, 2005, 06:54 AM
Yawmark's Avatar
Yawmark Yawmark is offline
Feelin' Groovy
Dev Shed God 11th Plane (10000 - 10499 posts)
 
Join Date: Aug 2001
Location: WDSMIA
Posts: 10,135 Yawmark User rank is General 61st Grade (Above 100000 Reputation Level)Yawmark User rank is General 61st Grade (Above 100000 Reputation Level)Yawmark User rank is General 61st Grade (Above 100000 Reputation Level)Yawmark User rank is General 61st Grade (Above 100000 Reputation Level)Yawmark User rank is General 61st Grade (Above 100000 Reputation Level)Yawmark User rank is General 61st Grade (Above 100000 Reputation Level)Yawmark User rank is General 61st Grade (Above 100000 Reputation Level)Yawmark User rank is General 61st Grade (Above 100000 Reputation Level)Yawmark User rank is General 61st Grade (Above 100000 Reputation Level)Yawmark User rank is General 61st Grade (Above 100000 Reputation Level)Yawmark User rank is General 61st Grade (Above 100000 Reputation Level)Yawmark User rank is General 61st Grade (Above 100000 Reputation Level)Yawmark User rank is General 61st Grade (Above 100000 Reputation Level)Yawmark User rank is General 61st Grade (Above 100000 Reputation Level)Yawmark User rank is General 61st Grade (Above 100000 Reputation Level)Yawmark User rank is General 61st Grade (Above 100000 Reputation Level) 
Time spent in forums: 3 Months 1 Week 4 Days 1 h 22 m 45 sec
Reputation Power: 5052
Send a message via ICQ to Yawmark Send a message via MSN to Yawmark
Quote:
Any pointers would be appreciated.

How would you do this if you didn't have a computer? If you can explain it to me step by step in detail, translating it to Java should be a breeze...
Comments on this post
tfecw agrees: this step is so important. I wish it was stressed more in programming 101
mrider agrees: Can't give rep points - but I agree 100%
__________________
Yawmark
class Sig{public static void main(String...args){\u0066or(int
\u0020$:"vÌÈÊ\"¤¾Àʲ¬Æ\"v¤Î¤\"²¤¨¸¬Æ".to\u0043h\u0061rArray()
)System./*goto/*$/%\u0126//^\u002A\u002Fout.print((char)(($>>
+(~'"'&'#'))+('<'>>('\\'/'.')/\u002Array.const(~1)\*\u002F)));}}

Reply With Quote
  #3  
Old November 15th, 2005, 06:59 AM
crownjewel82 crownjewel82 is offline
rebel with a cause
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: May 2004
Location: The Batsh!t Crazy State.
Posts: 5,817 crownjewel82 User rank is General 37th Grade (Above 100000 Reputation Level)crownjewel82 User rank is General 37th Grade (Above 100000 Reputation Level)crownjewel82 User rank is General 37th Grade (Above 100000 Reputation Level)crownjewel82 User rank is General 37th Grade (Above 100000 Reputation Level)crownjewel82 User rank is General 37th Grade (Above 100000 Reputation Level)crownjewel82 User rank is General 37th Grade (Above 100000 Reputation Level)crownjewel82 User rank is General 37th Grade (Above 100000 Reputation Level)crownjewel82 User rank is General 37th Grade (Above 100000 Reputation Level)crownjewel82 User rank is General 37th Grade (Above 100000 Reputation Level)crownjewel82 User rank is General 37th Grade (Above 100000 Reputation Level)crownjewel82 User rank is General 37th Grade (Above 100000 Reputation Level)crownjewel82 User rank is General 37th Grade (Above 100000 Reputation Level)crownjewel82 User rank is General 37th Grade (Above 100000 Reputation Level)crownjewel82 User rank is General 37th Grade (Above 100000 Reputation Level)crownjewel82 User rank is General 37th Grade (Above 100000 Reputation Level)crownjewel82 User rank is General 37th Grade (Above 100000 Reputation Level)  Folding Points: 53188 Folding Title: Beginner FolderFolding Points: 53188 Folding Title: Beginner FolderFolding Points: 53188 Folding Title: Beginner Folder
Time spent in forums: 3 Months 4 Days 12 h 16 m 39 sec
Reputation Power: 3461
How much programming do you understand.
Loops
Calling Methods
Arrays
Doesn't really matter what language as long as you understand those concepts although it would help if you were familiar with them in java.
__________________
Dear God. What is it like in your funny little brains? It must be so boring.

Reply With Quote
  #4  
Old November 15th, 2005, 07:43 AM
Calaen Calaen is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2005
Posts: 19 Calaen User rank is Corporal (100 - 500 Reputation Level)Calaen User rank is Corporal (100 - 500 Reputation Level)Calaen User rank is Corporal (100 - 500 Reputation Level)Calaen User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 5 h 35 m 15 sec
Reputation Power: 0
I understand loops but very basic.

I am not here for someone to do the thing for me I am just asking for pointers on how to work out the length of a string.

Reply With Quote
  #5  
Old November 15th, 2005, 07:44 AM
Yawmark's Avatar
Yawmark Yawmark is offline
Feelin' Groovy
Dev Shed God 11th Plane (10000 - 10499 posts)
 
Join Date: Aug 2001
Location: WDSMIA
Posts: 10,135 Yawmark User rank is General 61st Grade (Above 100000 Reputation Level)Yawmark User rank is General 61st Grade (Above 100000 Reputation Level)Yawmark User rank is General 61st Grade (Above 100000 Reputation Level)Yawmark User rank is General 61st Grade (Above 100000 Reputation Level)Yawmark User rank is General 61st Grade (Above 100000 Reputation Level)Yawmark User rank is General 61st Grade (Above 100000 Reputation Level)Yawmark User rank is General 61st Grade (Above 100000 Reputation Level)Yawmark User rank is General 61st Grade (Above 100000 Reputation Level)Yawmark User rank is General 61st Grade (Above 100000 Reputation Level)Yawmark User rank is General 61st Grade (Above 100000 Reputation Level)Yawmark User rank is General 61st Grade (Above 100000 Reputation Level)Yawmark User rank is General 61st Grade (Above 100000 Reputation Level)Yawmark User rank is General 61st Grade (Above 100000 Reputation Level)Yawmark User rank is General 61st Grade (Above 100000 Reputation Level)Yawmark User rank is General 61st Grade (Above 100000 Reputation Level)Yawmark User rank is General 61st Grade (Above 100000 Reputation Level) 
Time spent in forums: 3 Months 1 Week 4 Days 1 h 22 m 45 sec
Reputation Power: 5052
Send a message via ICQ to Yawmark Send a message via MSN to Yawmark
Code:
String.length()


Example:

Java Code:
Original - Java Code
  1. System.out.println("foo".length()); // 3
  2.  


It's an extremely important skill to learn to read the API and become familiar with the tools you will use to program Java. Java has an extensive set of documentation that you can even download for your convenience. These "javadocs" are indexed and categorized so you can quickly look up any class or method. Take the time to consult this resource whenever you have a question - you'll find they typically contain very detailed descriptions and possibly some code examples.

Java™ API Specifications
Java™ 1.5 JDK Javadocs
Comments on this post
bullet agrees!
ishnid agrees!

Reply With Quote
  #6  
Old November 15th, 2005, 08:52 AM
Calaen Calaen is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2005
Posts: 19 Calaen User rank is Corporal (100 - 500 Reputation Level)Calaen User rank is Corporal (100 - 500 Reputation Level)Calaen User rank is Corporal (100 - 500 Reputation Level)Calaen User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 5 h 35 m 15 sec
Reputation Power: 0
Much appreciated just what I needed.

Reply With Quote
  #7  
Old November 15th, 2005, 09:46 AM
Yawmark's Avatar
Yawmark Yawmark is offline
Feelin' Groovy
Dev Shed God 11th Plane (10000 - 10499 posts)
 
Join Date: Aug 2001
Location: WDSMIA
Posts: 10,135 Yawmark User rank is General 61st Grade (Above 100000 Reputation Level)Yawmark User rank is General 61st Grade (Above 100000 Reputation Level)Yawmark User rank is General 61st Grade (Above 100000 Reputation Level)Yawmark User rank is General 61st Grade (Above 100000 Reputation Level)Yawmark User rank is General 61st Grade (Above 100000 Reputation Level)Yawmark User rank is General 61st Grade (Above 100000 Reputation Level)Yawmark User rank is General 61st Grade (Above 100000 Reputation Level)Yawmark User rank is General 61st Grade (Above 100000 Reputation Level)Yawmark User rank is General 61st Grade (Above 100000 Reputation Level)Yawmark User rank is General 61st Grade (Above 100000 Reputation Level)Yawmark User rank is General 61st Grade (Above 100000 Reputation Level)Yawmark User rank is General 61st Grade (Above 100000 Reputation Level)Yawmark User rank is General 61st Grade (Above 100000 Reputation Level)Yawmark User rank is General 61st Grade (Above 100000 Reputation Level)Yawmark User rank is General 61st Grade (Above 100000 Reputation Level)Yawmark User rank is General 61st Grade (Above 100000 Reputation Level) 
Time spent in forums: 3 Months 1 Week 4 Days 1 h 22 m 45 sec
Reputation Power: 5052
Send a message via ICQ to Yawmark Send a message via MSN to Yawmark
Quote:
Originally Posted by tfecw
this step is so important. I wish it was stressed more in programming 101

One thing that really drove home the point for me recently was a book containing a series of old Scientific American articles. One article was about a fictional tribe called the "Apraphulians" (April fools) that built a series of logical gates from ropes, boxes, and pulleys. Another was about some MIT students who built a computer that plays tic-tac-toe out of Tinkertoys. Not only were the articles fascinating, but they reveal the importance of thinking about the problem domain first and foremost. The computer (and the language used to communicate with it) is just another tool; what really matters is the algorithm...
Comments on this post
crownjewel82 agrees: Oh how I wish I had points to give you
mvantuyl agrees!

Reply With Quote
  #8  
Old November 15th, 2005, 10:11 AM
crownjewel82 crownjewel82 is offline
rebel with a cause
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: May 2004
Location: The Batsh!t Crazy State.
Posts: 5,817 crownjewel82 User rank is General 37th Grade (Above 100000 Reputation Level)crownjewel82 User rank is General 37th Grade (Above 100000 Reputation Level)crownjewel82 User rank is General 37th Grade (Above 100000 Reputation Level)crownjewel82 User rank is General 37th Grade (Above 100000 Reputation Level)crownjewel82 User rank is General 37th Grade (Above 100000 Reputation Level)crownjewel82 User rank is General 37th Grade (Above 100000 Reputation Level)crownjewel82 User rank is General 37th Grade (Above 100000 Reputation Level)crownjewel82 User rank is General 37th Grade (Above 100000 Reputation Level)crownjewel82 User rank is General 37th Grade (Above 100000 Reputation Level)crownjewel82 User rank is General 37th Grade (Above 100000 Reputation Level)crownjewel82 User rank is General 37th Grade (Above 100000 Reputation Level)crownjewel82 User rank is General 37th Grade (Above 100000 Reputation Level)crownjewel82 User rank is General 37th Grade (Above 100000 Reputation Level)crownjewel82 User rank is General 37th Grade (Above 100000 Reputation Level)crownjewel82 User rank is General 37th Grade (Above 100000 Reputation Level)crownjewel82 User rank is General 37th Grade (Above 100000 Reputation Level)  Folding Points: 53188 Folding Title: Beginner FolderFolding Points: 53188 Folding Title: Beginner FolderFolding Points: 53188 Folding Title: Beginner Folder
Time spent in forums: 3 Months 4 Days 12 h 16 m 39 sec
Reputation Power: 3461
I so wish more people understood that necessity in programing. I had the benefit of a teacher who cared enough about our proper education in programming that he didn't let us touch a computer or teach us a scrap of any programming language until he taught us how algorithms work. I swear we spent less than half the semester in the lab but when we finished that course we were better coders than most of the CS majors at my university. (This was in high school.) I've tutored programming students for years and only a few have ever been able to grasp that the algorithm is the solution not the syntax.
Comments on this post
mrider agrees!

Reply With Quote
  #9  
Old November 15th, 2005, 10:27 AM
tfecw tfecw is offline
Contributing User
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Nov 2004
Location: Washington DC
Posts: 2,756 tfecw User rank is General 9th Grade (Above 100000 Reputation Level)tfecw User rank is General 9th Grade (Above 100000 Reputation Level)tfecw User rank is General 9th Grade (Above 100000 Reputation Level)tfecw User rank is General 9th Grade (Above 100000 Reputation Level)tfecw User rank is General 9th Grade (Above 100000 Reputation Level)tfecw User rank is General 9th Grade (Above 100000 Reputation Level)tfecw User rank is General 9th Grade (Above 100000 Reputation Level)tfecw User rank is General 9th Grade (Above 100000 Reputation Level)tfecw User rank is General 9th Grade (Above 100000 Reputation Level)tfecw User rank is General 9th Grade (Above 100000 Reputation Level)tfecw User rank is General 9th Grade (Above 100000 Reputation Level)tfecw User rank is General 9th Grade (Above 100000 Reputation Level)tfecw User rank is General 9th Grade (Above 100000 Reputation Level)tfecw User rank is General 9th Grade (Above 100000 Reputation Level)tfecw User rank is General 9th Grade (Above 100000 Reputation Level)tfecw User rank is General 9th Grade (Above 100000 Reputation Level) 
Time spent in forums: 3 Months 1 Week 3 Days 8 h 50 m 8 sec
Reputation Power: 1570
Send a message via AIM to tfecw
I still get weird looks when i raid the recycling bins for scrap paper at work.

Reply With Quote
  #10  
Old November 15th, 2005, 11:34 AM
mrider's Avatar
mrider mrider is offline
<- My daily commute :^)
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Mar 2005
Location: Earth. Welcome.
Posts: 1,501 mrider User rank is General 11st Grade (Above 100000 Reputation Level)mrider User rank is General 11st Grade (Above 100000 Reputation Level)mrider User rank is General 11st Grade (Above 100000 Reputation Level)mrider User rank is General 11st Grade (Above 100000 Reputation Level)mrider User rank is General 11st Grade (Above 100000 Reputation Level)mrider User rank is General 11st Grade (Above 100000 Reputation Level)mrider User rank is General 11st Grade (Above 100000 Reputation Level)mrider User rank is General 11st Grade (Above 100000 Reputation Level)mrider User rank is General 11st Grade (Above 100000 Reputation Level)mrider User rank is General 11st Grade (Above 100000 Reputation Level)mrider User rank is General 11st Grade (Above 100000 Reputation Level)mrider User rank is General 11st Grade (Above 100000 Reputation Level)mrider User rank is General 11st Grade (Above 100000 Reputation Level)mrider User rank is General 11st Grade (Above 100000 Reputation Level)mrider User rank is General 11st Grade (Above 100000 Reputation Level)mrider User rank is General 11st Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 3 Weeks 5 Days 18 h 14 m
Reputation Power: 1697
Quote:
only a few have ever been able to grasp that the algorithm is the solution not the syntax.

I also wish people would grasp the concept of only optimizing when it becomes necessary. How frequently do we see code that is terribly convoluted in the quest for a 1% improvement in speed, when in fact the code in question is only accessed occasionally?

This goes back to the statement that it's best to understand the algorithm ahead of time. It's much easier to write clean, clear, correct code if the necessary steps for accomplishing a task are understood ahead of time.
__________________
A -> B: Ride.

Reply With Quote
  #11  
Old November 15th, 2005, 12:20 PM
crownjewel82 crownjewel82 is offline
rebel with a cause
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: May 2004
Location: The Batsh!t Crazy State.
Posts: 5,817 crownjewel82 User rank is General 37th Grade (Above 100000 Reputation Level)crownjewel82 User rank is General 37th Grade (Above 100000 Reputation Level)crownjewel82 User rank is General 37th Grade (Above 100000 Reputation Level)crownjewel82 User rank is General 37th Grade (Above 100000 Reputation Level)crownjewel82 User rank is General 37th Grade (Above 100000 Reputation Level)crownjewel82 User rank is General 37th Grade (Above 100000 Reputation Level)crownjewel82 User rank is General 37th Grade (Above 100000 Reputation Level)crownjewel82 User rank is General 37th Grade (Above 100000 Reputation Level)crownjewel82 User rank is General 37th Grade (Above 100000 Reputation Level)crownjewel82 User rank is General 37th Grade (Above 100000 Reputation Level)crownjewel82 User rank is General 37th Grade (Above 100000 Reputation Level)crownjewel82 User rank is General 37th Grade (Above 100000 Reputation Level)crownjewel82 User rank is General 37th Grade (Above 100000 Reputation Level)crownjewel82 User rank is General 37th Grade (Above 100000 Reputation Level)crownjewel82 User rank is General 37th Grade (Above 100000 Reputation Level)crownjewel82 User rank is General 37th Grade (Above 100000 Reputation Level)  Folding Points: 53188 Folding Title: Beginner FolderFolding Points: 53188 Folding Title: Beginner FolderFolding Points: 53188 Folding Title: Beginner Folder
Time spent in forums: 3 Months 4 Days 12 h 16 m 39 sec
Reputation Power: 3461
I used to tutor discrete math too. Big O is a bitch to learn but once you do it's your best friend.

Reply With Quote
  #12  
Old November 15th, 2005, 01:47 PM
Calaen Calaen is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2005
Posts: 19 Calaen User rank is Corporal (100 - 500 Reputation Level)Calaen User rank is Corporal (100 - 500 Reputation Level)Calaen User rank is Corporal (100 - 500 Reputation Level)Calaen User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 5 h 35 m 15 sec
Reputation Power: 0
my attempt

Ok so I have given it ago and this is what I have come up with.

Code:
 import javax.swing.*;
 
 class While 
 {
   public static void main (String args[]) 
	{
		//This is what I have so far its not perfect and it has holes  all over it
		
		int length1, length2;
	    
		{
	        String input1 = JOptionPane.showInputDialog("Enter first word");
		    length1 = input1.length();
		    if (input1.length() > 37)
		    
		    
		      JOptionPane.showMessageDialog(null,"Please re-enter word",
              "Error word length exceeds 37", JOptionPane.ERROR_MESSAGE);
            
            
		    String input2 = JOptionPane.showInputDialog("Enter second word");
		    length2 = input2.length();
		    if (input2.length() > (38-length1))	    		    
		    
		    
		    JOptionPane.showMessageDialog(null,"Error total length of words exceeds 38",
            "Error", JOptionPane.ERROR_MESSAGE);
		    
		    
		    
		    int i = input1.length();
		   System.out.print(input1);
		    while (i < (40 - input2.length())) {
			System.out.print(".");
			i++;
             
            }
		    //print input 2
		    System.out.println(input2);
		} 
		while (length1+length2+2 <= 40);
		
	}
}


The main problem for me is I find I dont really understand it at all :-(

How do I make it loop back from the first input entry if its over 37 in length? And the same for the 2nd input if both together are over 38?

Its very frustrating this Java stuff.

Reply With Quote
  #13  
Old November 15th, 2005, 01:51 PM
bullet's Avatar
bullet bullet is offline
Java Junkie
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jan 2004
Location: Mobile, Alabama
Posts: 3,828 bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 6 Days 11 h 21 m 4 sec
Reputation Power: 1248
Send a message via ICQ to bullet Send a message via AIM to bullet Send a message via MSN to bullet
Keep in mind that most of the frustration you have is with the basic idea of programming, not with Java. People at my University normally take out frustrations on Java when they are really frustrated about programming. Trust me, you would have just as much trouble trying to make this work in C++.

First, you can't use a Java reserved word like While as an identifier.

Next, you want to make sure you understand the basic difference between an if and a while.

An if checks a condition, and based on that condition, may execute a statement, and then control passes to the next executable statement that follows the if block.

A while checks a condition, and will continue to execute the statements in the body of the while until the condition becomes false.

Reply With Quote
  #14  
Old November 15th, 2005, 01:51 PM
mvantuyl's Avatar
mvantuyl mvantuyl is offline
Walrus Gramps
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Aug 2005
Location: San Antonio, Texas
Posts: 1,229 mvantuyl User rank is Brigadier General (60000 - 70000 Reputation Level)mvantuyl User rank is Brigadier General (60000 - 70000 Reputation Level)mvantuyl User rank is Brigadier General (60000 - 70000 Reputation Level)mvantuyl User rank is Brigadier General (60000 - 70000 Reputation Level)mvantuyl User rank is Brigadier General (60000 - 70000 Reputation Level)mvantuyl User rank is Brigadier General (60000 - 70000 Reputation Level)mvantuyl User rank is Brigadier General (60000 - 70000 Reputation Level)mvantuyl User rank is Brigadier General (60000 - 70000 Reputation Level)mvantuyl User rank is Brigadier General (60000 - 70000 Reputation Level)mvantuyl User rank is Brigadier General (60000 - 70000 Reputation Level)mvantuyl User rank is Brigadier General (60000 - 70000 Reputation Level)mvantuyl User rank is Brigadier General (60000 - 70000 Reputation Level)mvantuyl User rank is Brigadier General (60000 - 70000 Reputation Level)  Folding Points: 48973 Folding Title: Beginner FolderFolding Points: 48973 Folding Title: Beginner FolderFolding Points: 48973 Folding Title: Beginner Folder
Time spent in forums: 3 Weeks 4 Days 5 h 55 m 23 sec
Reputation Power: 618
Send a message via ICQ to mvantuyl
"if its over 37 in length"
"if both together are over 38"

How would you express that in Java?

Reply With Quote
  #15  
Old November 15th, 2005, 01:55 PM
mvantuyl's Avatar
mvantuyl mvantuyl is offline
Walrus Gramps
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Aug 2005
Location: San Antonio, Texas
Posts: 1,229 mvantuyl User rank is Brigadier General (60000 - 70000 Reputation Level)mvantuyl User rank is Brigadier General (60000 - 70000 Reputation Level)mvantuyl User rank is Brigadier General (60000 - 70000 Reputation Level)mvantuyl User rank is Brigadier General (60000 - 70000 Reputation Level)mvantuyl User rank is Brigadier General (60000 - 70000 Reputation Level)mvantuyl User rank is Brigadier General (60000 - 70000 Reputation Level)mvantuyl User rank is Brigadier General (60000 - 70000 Reputation Level)mvantuyl User rank is Brigadier General (60000 - 70000 Reputation Level)mvantuyl User rank is Brigadier General (60000 - 70000 Reputation Level)mvantuyl User rank is Brigadier General (60000 - 70000 Reputation Level)mvantuyl User rank is Brigadier General (60000 - 70000 Reputation Level)mvantuyl User rank is Brigadier General (60000 - 70000 Reputation Level)mvantuyl User rank is Brigadier General (60000 - 70000 Reputation Level)  Folding Points: 48973 Folding Title: Beginner FolderFolding Points: 48973 Folding Title: Beginner FolderFolding Points: 48973 Folding Title: Beginner Folder
Time spent in forums: 3 Weeks 4 Days 5 h 55 m 23 sec
Reputation Power: 618
Send a message via ICQ to mvantuyl
Quote:
Originally Posted by bullet
<snip> First, you can't use a Java reserved word like While as an identifier. </snip>

Actually, 'while' is a reserved word, but 'While' isn't. (But it still isn't a good idea to use 'While' as a class name)

Reply With Quote
Closed Thread

Viewing: Dev Shed ForumsProgramming LanguagesJava Help > Java basic program guidance

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap