Java programming for the beginners. 5th article
Programming
|
PLEASE DON"T RANK IT YET- CAUSE IT"S NOT FINISHED YET
hey hey hey. got a long weekend here, so i thought of writing the 5th article
So like i said, i'll start talking about different IO ways, and in each article that will follow this one, i'll talk about different one specifically
section 2.3
Java allows the user to enter data in a variety of ways. i will try to explain three different methods of gathering user input. first will be DOS window based using the EasyReader class(the class which was written by some guy) because DOS-mode is not a �built-in� feature of JAVA. EasyReader class is an �add-on� to Java and is one of many different classes that have been written to gather user input in DOS mode (the other one that i heard of is Scanner class, but i will only learn it next year). i will speak more about later(if i'll get a chance of course, so stay tuned), for now it is important to know that Java does not have a built in method for collecting user input in DOS-mode a... View In Full
 |
0 Comments |
4.00 out of 10 |
|
|
Java programming for the beginners. 4th article
Programming
|
OK, hello again sorry for maiking you waiting that long, but this is first time i found some spare time and planned all my thoughts to write the fourth article. (also i can admit that i was a bit lazy)
As i finished with srings in a previous articled, i'll talk today about conversions of strings to integers and doubles and vise versa
section 2.2 conversion Methods
java allows to convert strings to numeric types (and numeric types to strings).
There are four methods that i would like to focus on:
1. string to integer 2. integer to string
3. string to double 3. double to string
string to integer:
To convert a string to an integer, use parseInt ( ), which is in the integer class:
Example int num;
String numString = �12345�;
num = Integer.parseInt(numString);
integer to string:
to convert an integer to a string, use the toString ( ), which is also in the integer class:
Example String numString;
int num = 12345;
numString = Integer.toStr... View In Full
 |
0 Comments |
7.00 out of 10 |
|
|
Java programming for the beginners. 3rd article
Programming
|
Hello CP members. Now I'm here again to write this 3rd useless article on Java (hope it's the other way around). So what do you think about previous articles? if you think taht it was hard, I'm telling you that you shouldn't read further but if you are interested then you are more than welcome to continue expanding your knowledge! Now Let's see where was I... oh here:
section 2.1- strings
In Java there is a way to use non-numerical data that is longer than one letter in length. This is all about the String class, There are also couple of methods that are used to perform various operations with that class including the following:
finding the length of the strings, finding a particular character in the string and comparing strings. I also think that there is a way of taking a part or specific section of the string but i forgot this method (if you know it, then send me a message and I'll include that stuff in. i'll also look it up online and will modify my article after).
Str... View In Full
 |
0 Comments |
6.00 out of 10 |
|
|
Java programming for beginners. Article 2
Programming
|
Hello again. As we finished discussing on how to declare different data types, today I�ll start with how to assign them a value. So consider the following:
Section 1.7
Once a variable has been declared, you can assign it a value (or initialize it while declaring it) using the equal sign.
Examples: age = 16;
int x = 9; //Initialization
//Assigning values
weight = 160;
amount = 11.63;
interestRate = .235
They also can be initialized using one statement:
Example: int age = 16, weight = 160;
double amount = 11.63, interestRate = .235;
section 1.8
Arithmetic Expressions.
Examples of simple arithmetic expressions are:
Addition + 12.62 + 9.8
Subtraction � 18 � 3
Multiplication * .08 * 12.2
Division / 12.6/2.0
Remainder (mod) % 3... View In Full
 |
0 Comments |
7.00 out of 10 |
|
|
Java programming for the beginners
Programming
|
Hello. I'm here to give you lesons on Java and will post an article appr. every 2-3 days. Those who used to program in C/C++ will see many similarities between C++ and Java. it is so becasue java is a language that combines a feature of C++ and SmallTalk OOL(object oriented language) so i will start with the basic stuff.
Your first few programs will have the general form:
// Your Name
// Computer Programming II - Java
// Date:
// Unit # 1
// Description: This is my very first program
public class NameOfClass
{
public static void main (String [ ] args)
{
statements will be written here
System.out.println(�My first program!�);
}
}
section1.1 Commenting your code
(//) as you probably guessed is an inline comment. it is very good to use comments, because comments are simply an English explanations to help you (and other programmers) understand your program.
The... View In Full
 |
1 Comments |
4.00 out of 10 |
|
|
|
 |
Gleb Sorokosh (17) Canada, Ontario |
|
Coding_Guy has 2 fans
become a fan |
|
 |
|
 |
|