Archive for the ‘Java Tutorials’ Category
Change font size in Eclipse
Posted on: August 25, 2012
Hey friends,
Many students & professionals were asking that how they can change the font size in Eclipse.
Here is the way to change the font size in Eclipse :
- Go to Window Menu > Preferences > General > Appearance > Colors and Fonts
- Then to change the font size : Go to Java > Java Editor Text Font > Edit
- Now set the font & font size you wish, done.
See Video Tutorial for above :
Enjoy Coding!
Hello World in different languages
Posted on: July 6, 2012
- In: C Language Source Code | C Language Tutorials | COBOL Source Code | COBOL Tutorials | CPP Source Code | CPP Tutorials | CSS Code | CSS Tutorials | How to's | HTML Code | HTML Tutorials | Java Source Code | Java Tutorials | JavaScript Tutorials | PHP Source Code | PHP Tutorials | Web Design Tutorials
- 4 Comments
Objectives :
* How to write Hello World in Java?
* How to write Hello World in C?
* How to write Hello World in PHP?
* How to write Hello World in C++?
* How to write Hello World in JavaScript?
* How to write Hello World in HTML?
* How to write Hello World in CSS?
* How to write Hello World in COBOL?
Java
class HelloWorld
{
public static void main(String args[])
{
System.out.println(“Hello World!”);
}
}
C
#include
#include
void main()
{
clrscr();
printf(“Hello World!”);
getch();
}
C++
#include
#include
void main()
{
clrscr();
cout<getch();
}
CSS
body:before
{
content: “Hello World”;
}
COBOL
**************************** IDENTIFICATION DIVISION. PROGRAM-ID. HELLO ENVIRONMENT DIVISION. DATA DIVISION. PROCEDURE DIVISION. MAIN SECTION. DISPLAY “Hello World!” STOP RUN ****************************
HTML
<html> <head> <title>Hello World Example</title> </head> <body> Hello World! </body> </html>
JavaScript
document.write("Hello World");
PHP
<!--?php echo ‘Hello World!’ ?-->
Linux Shell Script
echo "Hello World !"
Enjoy coding!
Posted from WordPress for Android
Get MAC Address using Java
Posted on: June 11, 2012
Objective :
* How to get the MAC Address of a computer?
* How to get the MAC Address of a computer using Java?
* How to get the MAC Address of a computer via programming?
import java.net.*;
class GetMac
{
public static void main(String arg[])
{
try
{
InetAddress address = InetAddress.getLocalHost();
NetworkInterface nwi = NetworkInterface.getByInetAddress(address);
byte mac[] = nwi.getHardwareAddress();
System.out.println(mac);
}
catch(Exception e)
{
System.out.println(e);
}
}
}
Note : This code will return only the first net address; if you need other detils too, get a list.
Posted from WordPress for Android
HelloWorld – Core Java Tutorial
Posted on: January 10, 2012
Objective :
- How to write a simple Java program?
- How to write Hello in Java?
- How to write HelloWorld in Java?
- How to write & execute a simple Java program?
- How to write Java program using Notepad & execute using Command Prompt?
Posted from WordPress for Android
Ws of Java
Posted on: December 12, 2011
Architecture of Java Program
Posted on: November 25, 2011
Objective :
- What is architecture of Java program?
While writing a java program, the above architecture need to be followed.
As the figure describes, documentation part or writing comments into program is completely optional. If you want to know, how to write comments & documentation in java? Click here
If the programmer wants to keep class in some package then only he/she will declare the package.
If we need to link any other class from some package then, we will write import statement otherwise if the classes are in same package there is no need of import statement.
Whereas class definition & program body is compulsory which will have your actual code.
Data Types in Java
Posted on: October 17, 2011
In Java there are total 8 data types available which are further divided into 4 groups viz. integers, floating point numbers, character & boolean values.
|
Type |
Size in Bytes (Bits) |
Range |
Default value |
Contains |
| Integers | ||||
| Byte | 1 byte (8 bits) | -128 to 127 | 0 | Signed Integer |
| Short | 2 bytes
(16 bits) |
-32768 to 32767 | 0 | Signed Integer |
| Int | 4 bytes
(32 bits) |
-2147483648 to 2147483647 | 0 | Signed Integer |
| Long | 8 bytes
(64 bits) |
-9223372036854775808 to 9223372036854775807 | 0 | Signed Integer |
| Floating point numbers | ||||
| Float | 4 bytes
(32 bits) |
-3.4e38 to 3.4e38
(i.e. 3.4*1017) |
0.0 | IEEE754 Floating point number |
| Double | 8 bytes
(64 bits) |
-1.7e308 to 1.7e308
(i.e. 1.7*10151) |
0.0 | IEEE754 Floating point number |
| Characters | ||||
| char | 2 bytes
(16 bits) |
\u0000 to \uFFFF | \u0000 | Unicode Characters |
| Boolean values | ||||
| boolean | 1 bit | Not Applicable | False | true or false |
|
Table : Data Types in Java |
||||
How to set Path for Java
Posted on: August 24, 2011
- In: How to's | Java | Java Tutorials | Video Tutorials
- 12 Comments
Dear Friends,
If you want to set the path for Java, there are two main types for setting system path for Java which are as follows;
- Temporary Path
- Permanent Path
For the above two types, the video describes the complete step by step procedure for setting path for Java :
Or you can go through this tutorial :
f. But if the other message having length nearly equal to half a page then path is set.
3. Permanent Path :












