Data Types | |
---|---|
Premitive | Object |
Integers
| (reference data type or array data type) Ex: String |
Floating point
| |
Characters
| |
Boolean
|
Showing posts with label it notes. Show all posts
Showing posts with label it notes. Show all posts
Tuesday, March 31, 2015
Data Types in JAVA
Sunday, March 29, 2015
Getting started with JAVA programming
Getting started with JAVA programming
Are you new to java? If yes here is the way to become a java expert. How to install JAVA Development Kit on your computer
Step 1
Download java development kit from oracle.
Click here to download. (Use the images to get an idea)
Click on accept
Select your download type 64 bit or 32 bit
and wait until downlaod complete.
Step
2
After
download complete run the setup.
Step
3
Do
not change install location and set it to be default
Step
4
Wait
until installation to be complete.
Step
5
Now
you have JAVA installed in your computer.
Step
6
Then
you need to set path to compile a java program. Here is the way.
Go
to your java installed location. In my case it may be c:\program
files\java\jdk1.7.0\ (may vary due to java version)
Open
that folder.
Now
you are inside the folder named “My docs”
Now open notepad and type start and save it as “cmd.bat” in “My docs” folder.
Now open notepad and type start and save it as “cmd.bat” in “My docs” folder.
if
you are a window 8 user follow these steps;
- Drag the Mouse pointer to the Right bottom corner of the screen
- Click on the Search icon and type: Control Panel
- Now click on variable value field, put a ; at end of the value.
- click on ok then again ok and ok.
Now
go to c:\program
files\java\jdk1.7.0\My docs
Now
open CMD.bat file
Then
type “javac” and press enter
Now
it is time to code java.
}
Now save this as "a1.java" in "My docs" folder.
Now open "CMD.bat" and type javac a1.java and press enter
Then if it was successful type java a1 and press enter.
Now in cmd you can see a text "hello JAVA".
Now do not close cmd keep it minimized and code some more java program.then save it.
Now again type javac and then type name of your saved java program with .java extension .
Then type java and saved java program and press enter.
How to start java coding
Now you can start to code java. Here is an example
Open notepad .Type these text
class a1{ public static void main(String args[]){ System.out.println("Hello JAVA"); }
}
Now save this as "a1.java" in "My docs" folder.
Now open "CMD.bat" and type javac a1.java and press enter
Then if it was successful type java a1 and press enter.
Now in cmd you can see a text "hello JAVA".
Now do not close cmd keep it minimized and code some more java program.then save it.
Now again type javac and then type name of your saved java program with .java extension .
Then type java and saved java program and press enter.
-------------------------------------------------------------
RECOMMENDED BY AUTHOR
Wednesday, February 4, 2015
Use of colors in HTML
we can use RGB colors in web pages to make the page more colorful.
Syntax of RGB color code is rgb(rr,gg,bb)
As an example to show green color using RGB code we can write as following, rgb(0,255,0)
You can get RGB code of a color by using “Adobe Photoshop” or any image processing software. But in HTML we us corresponding hexadecimal value of a RGB color code.
Example : for red color
But most web browsers support 17 main colors.
They are
We can use following HTML code
<HTML>
<HEAD>
<TITLE>Colors</TITLE>
</HEAD>
<BODY>
<H1><FONT color=”red”>This is in red color</FONT></H1>
<H2><FONT color=#0000FF >This is in green</FONT></H2>
<P><FONT color=”blue”>This is some text</FONT></P>
</BODY>
</HTML>
The output will be,
Syntax of RGB color code is rgb(rr,gg,bb)
As an example to show green color using RGB code we can write as following, rgb(0,255,0)
You can get RGB code of a color by using “Adobe Photoshop” or any image processing software. But in HTML we us corresponding hexadecimal value of a RGB color code.
Example : for red color
- RGB value = (255,0,0)
- Hex value = #ff0000
But most web browsers support 17 main colors.
They are
- Aqua
- Black
- Blue
- Fuchsia
- Gray
- Green
- Lime
- Maroon
- Navy
- Olive
- Orange
- Purple
- Red
- Sliver
- Teal
- White
- Yellow
We can use following HTML code
<HTML>
<HEAD>
<TITLE>Colors</TITLE>
</HEAD>
<BODY>
<H1><FONT color=”red”>This is in red color</FONT></H1>
<H2><FONT color=#0000FF >This is in green</FONT></H2>
<P><FONT color=”blue”>This is some text</FONT></P>
</BODY>
</HTML>
The output will be,
How to use background colors.
<HTML>
<HEAD>
<TITLE>Colors</TITLE>
</HEAD>
<BODY BGCOLOR=”orange”>
<H1><FONT color=”red”>This is in red color</FONT></H1>
<H2><FONT color=#0000FF >This is in green</FONT></H2>
<P><FONT color=”blue”>This is some text</FONT></P>
</BODY>
</HTML>
output,
<HTML>
<HEAD>
<TITLE>Colors</TITLE>
</HEAD>
<BODY BGCOLOR=”orange”>
<H1><FONT color=”red”>This is in red color</FONT></H1>
<H2><FONT color=#0000FF >This is in green</FONT></H2>
<P><FONT color=”blue”>This is some text</FONT></P>
</BODY>
</HTML>
output,
Friday, December 5, 2014
How to use heading tags in HTML
Use of headings
We can use heading tag to indicate our text as a heading.
There are six type of headings.
<H1>Your Text</H1>
<H2>Your Text</H2>
<H3>Your Text</H3>
<H4>Your Text</H4>
<H5>Your Text</H5>
<H6>Your Text</H6>
Example:
<HTML>
<HEAD><TITLE>Headings</TITLE></HEAD>
<BODY>
<H1>First level heading</H1>
<H2>Second level heading</H2>
<H3>Third level heading</H3>
<H4>Fourth level heading</H4>
<H5>Fifth level heading</H5>
<H6>Sixth level heading</H6>
</BODY>
</HTML>
Save this as headings.html in mysite folder
Output will be,
We can align headings to center, left or right. To align ,
<H1 align=”Center”>First heading</H1>
This will align the text “First heading” to center screen of your web browser.
We can use heading tag to indicate our text as a heading.
There are six type of headings.
<H1>Your Text</H1>
<H2>Your Text</H2>
<H3>Your Text</H3>
<H4>Your Text</H4>
<H5>Your Text</H5>
<H6>Your Text</H6>
Example:
<HTML>
<HEAD><TITLE>Headings</TITLE></HEAD>
<BODY>
<H1>First level heading</H1>
<H2>Second level heading</H2>
<H3>Third level heading</H3>
<H4>Fourth level heading</H4>
<H5>Fifth level heading</H5>
<H6>Sixth level heading</H6>
</BODY>
</HTML>
Save this as headings.html in mysite folder
Output will be,
We can align headings to center, left or right. To align ,
<H1 align=”Center”>First heading</H1>
This will align the text “First heading” to center screen of your web browser.
Tuesday, November 18, 2014
Monday, November 17, 2014
Key Words in Python
Key Words in Python
Key words are the reserved words that use for specific command.
You can see those key words below.
and
|
del
|
form
|
not
|
with
|
as
|
elif
|
global
|
or
|
while
|
assert
|
else
|
if
|
pass
|
yield
|
break
|
except
|
import
|
print
|
|
class
|
exec
|
in
|
return
|
|
continue
|
finally
|
is
|
raise
|
|
def
|
for
|
lambda
|
try
|
As python is case sensitive language you should type those keywords in simple letters.
If you are using default settings in python GUI these key words are orange colored or purple colored.
Sunday, November 16, 2014
Introduction & Arithmetic Functions
Introduction to Python
Let’s work with some arithmetic problems.
(you can type an expression in python gui then press enter for the result)
1).2+5 2).5/2 3).9/3 4).9.0/3 5).9.0/3.0 6).2**3+8
---------------------------------------------------------------------------------------------------------------
we can use mode function using “%” symbol.
7).5%3 ;(Gives remainder)
N.B. Check out above highlighted ones. They gives different answers.
# is used to indicate comments in python.
You do not need to type those comments.
How to calculate complex arithmetic.
example 1 : 20/7*2.0**/1.5
Steps:
First name the symbols according to their simplification order.
(Refer the order mentioned above)
20/7*2.0**3/1.5
(3) (3) (2) (3)
- If you have same order number in many locations number them from left to right.20/7*2.0**3/1.5(3) (3) (2) (3)(1) (2) (3)
- Then simplify according to step 1 or if you have to do step to do the calculation from left to right20/7*2.0**3/1.5(3) (3) (2) (3) highlighted one first(1) (2) (3)20/7*8.0/1.5(3) (3) (3) highlighted one first(1) (2) (3)2*8.0/1.5(3) (3) highlighted one first(2) (3)16.0/1.5(3) highlighted one first(3)10.666666666666666 This is the answer
First try these problems with your mind. Then check out in python gui .
- 45/6*5-6
- 5*4*(3+4)+6%4
- 7.0*5+2**4*(8/5+5*(9%4)-3
Labels:
a/l it,
AL IT,
it,
it notes,
learn python,
learn python easy,
python,
Tutorials
Subscribe to:
Posts (Atom)