This is a small blog for programming.I want to share my thinking,creation and learning to all of you.I also want to develop my own skill as well as yours.
Friday, September 26, 2014
Using Multiple Class In Java
Program:
package munim2;
import java.util.Scanner;
public class rab {
public static void main(String[]args){
Scanner mon=new Scanner(System.in);
jab jabobject=new jab ();
System.out.println("Enter your real name: ");
String name=mon.nextLine();
jabobject.dress(name);
}
}
You must have to take another class to the same source file of the same package.
package munim2;
public class jab {
public static void dress(String name){
System.out.println("Hey "+name);
}
}
Follow the screenshots:
package munim2;
import java.util.Scanner;
public class rab {
public static void main(String[]args){
Scanner mon=new Scanner(System.in);
jab jabobject=new jab ();
System.out.println("Enter your real name: ");
String name=mon.nextLine();
jabobject.dress(name);
}
}
You must have to take another class to the same source file of the same package.
package munim2;
public class jab {
public static void dress(String name){
System.out.println("Hey "+name);
}
}
Follow the screenshots:
Screenshots
Set Class
Program
Output
Wednesday, September 24, 2014
Monday, September 22, 2014
Find Average Using While Loop In Java
Program:
import java.util.Scanner;
public class readerr {
public static void main(String[]args){
Scanner mon=new Scanner(System.in);
double total=0;
double one;
double count = 0;
double average;
while(count<10){
one=mon.nextDouble();
total=total+one;
count++;
}
average=total/10;
System.out.println("the average of the numbers is "+total);
}
}
import java.util.Scanner;
public class readerr {
public static void main(String[]args){
Scanner mon=new Scanner(System.in);
double total=0;
double one;
double count = 0;
double average;
while(count<10){
one=mon.nextDouble();
total=total+one;
count++;
}
average=total/10;
System.out.println("the average of the numbers is "+total);
}
}
Screenshots
Program
Output
where is the wrong keyword written.........find out
Find Average by Scanning In Java
Program:
package munim;
import java.util.Scanner;
public class reader {
public static void main(String[]args){
double a,b,c,average;
Scanner mon=new Scanner(System.in);
a=mon.nextDouble();
b=mon.nextDouble();
c=mon.nextDouble();
average=(a+b+c)/3;
System.out.println("the average is "+average);
}
}
package munim;
import java.util.Scanner;
public class reader {
public static void main(String[]args){
double a,b,c,average;
Scanner mon=new Scanner(System.in);
a=mon.nextDouble();
b=mon.nextDouble();
c=mon.nextDouble();
average=(a+b+c)/3;
System.out.println("the average is "+average);
}
}
Screenshots
Progam
Output
else if Statement In Java Programming
Program:
package munim;
import java.util.Scanner;
public class real {
public static void main(String[] args){
Scanner mon=new Scanner(System.in);
double size;
size=mon.nextDouble();
if(size>40)
System.out.println("there are not dress in your size");
else{
if(size<10)
System.out.println("the dress start from 10 size");
else
System.out.println("there is a dress for you");
}
}
}
package munim;
import java.util.Scanner;
public class real {
public static void main(String[] args){
Scanner mon=new Scanner(System.in);
double size;
size=mon.nextDouble();
if(size>40)
System.out.println("there are not dress in your size");
else{
if(size<10)
System.out.println("the dress start from 10 size");
else
System.out.println("there is a dress for you");
}
}
}
Screenshots
program
Output
Thursday, September 4, 2014
Javascript Concept
Javascript:
Javascript is a script which is used in a webpage for dynamic view.It is a scripting language.
At the beginning of the javascript you have to follow these steps.
1.At first you have to download a code editor like notepad++.
2.You must have to know HTML and CSS.
3.Then open notepad++ and write these code.
First code:
<html>
<head>
<title>creativity</title>
</head>
<body>
<script type="text/javascript">
document.write("please touch it");
</script>
</body>
</html>
4.Next you have to save the file anywhere and the file type must be .js and .html extension.And must put the both file in the same folder.
5.Run the HTML file on your browser and get the output below.
Follow the screenshots.
Output on the browser: please touch it.
Javascript is a script which is used in a webpage for dynamic view.It is a scripting language.
At the beginning of the javascript you have to follow these steps.
1.At first you have to download a code editor like notepad++.
2.You must have to know HTML and CSS.
3.Then open notepad++ and write these code.
First code:
<html>
<head>
<title>creativity</title>
</head>
<body>
<script type="text/javascript">
document.write("please touch it");
</script>
</body>
</html>
4.Next you have to save the file anywhere and the file type must be .js and .html extension.And must put the both file in the same folder.
5.Run the HTML file on your browser and get the output below.
Follow the screenshots.
Output on the browser: please touch it.
Screenshots
Two
Three
Four
Output after run the html file on browser
Subscribe to:
Posts (Atom)