Technology Guruu

  • Home
  • Site Info
    • About Us
    • Disclaimer
    • Privacy Polacy
  • Home
  • Digital Marketing
    • SEO
    • SMM
    • SEM
  • Quotes
  • Technical
  • Java
  • .Net
    • C#.Net
    • ASP.Net
  • Keychains

Wednesday, 13 April 2016

Top 8 Technical Questions and Answers in Java

 Akansha     11:30:00     TechnicalQuestions     No comments   

Today I Would like write an article about Java Basic Programs here you have find some programs start with basic and also implement large programs.Every Programing tells how to write java code. java is case sensitive language concentrate on writing class name and main method and body in the program.

Logical Programs In Java

question

1.Write a program To Print" HELLO WORLD "in Java?

class Hello
{
public static void main(String[] args)
{
System.out.println("Hello World!");
}
}

2.Write a program to addition of two numbers in java?

import java.util.*;
class  Add
{
public static void main(String[] args) 
{
    int a,b,c;
Scanner s=new Scanner(System.in);
System.out.println("enter a,b values:");
a=s.nextInt();
b=s.nextInt();
c=a+b;
System.out.println("the sum is"+c);
}
}
              (or)
class  Addition
{
public static void main(String[] args) 
{
int a=5,b=15,c;
c=a+b;
System.out.println(c);
}
}

3.Write a program for Array Index Out Of Bounds Exception in Java?

class Arg 
{
public static void main(String args[]) 
{  
try
{
System.out.println(args[0]);
}
catch (Exception e)
{
System.out.println(e);
}
}
}

4.Check whether given Number is Armstrong or Not in Java?

import java.util.*;
class  Armstrong
{
public static void main(String[] args) 
{
int m,n,r,sum=0;
System.out.println("enter n val");
Scanner s=new Scanner(System.in);
n=s.nextInt();
m=n;
while(m>=1)
{
 r=m%10;
 sum=sum+r*r*r;
 m=m/10;
}
  if(sum==n)
System.out.println("armstrong");
else
System.out.println("not armstrong");
}
}

5.Program Ascii Value increamentation?

class  Ascii
{
public static void main(String[] args) 
{
char c='A';
System.out.println(c);
     c++;
    System.out.println(c);
}
}
o/p:
        A
        B

6.program for Date Display?

import java.util.*;
class  Date
{
public static void main(String[] args) 
{
Date d=new Date();
System.out.println(d);
}
}

7.Write a program print the Numbers in any Range?

import java.util.*;
class Format 
{
public static void main(String[] args) 
{int n,k;
System.out.println("enter the range");
Scanner s=new Scanner(System.in);
n=s.nextInt();
for(int i=1;i<=n;i++)
{
for(int j=1;j<=i;j++)
{k=i;

System.out.print(k);
k++;
}
System.out.println();
}
}
}

8.Write a program for checking greater number in given numbers?

class  Greater
{
public static void main(String[] args) 
{
int a=20,b=30,e=40,f=50;
boolean c=a>b;
boolean d=e>=f;
if(c)
{
System.out.println(a+">"+b);
}
else
{
System.out.println(a+"<"+b);
}
if(d)
{
System.out.println(e+">="+f);
}
else
{
System.out.println(e+"<="+f);
}
}
}
Friends today I start to write java programs for java learners .so,please concentrate on Java Programs and also Share this to your Friends Through Facebook,Twitter,Google+ .Do have any ideas are complaints please comment ,thank you friends.
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Email ThisBlogThis!Share to XShare to Facebook
Newer Post Older Post Home

0 comments:

Post a Comment

Popular Posts

  • Brief description about Delegates
    Introduction about delegates and why delegates are came the main purpose of delegates how to useful and what are the advantages and disadv...
  • Missing My Friend Quotes : Friendship Day Quotes 2017
    Friends today my article about missing friends and moments with them. Here you are seen the best friendship quotes and some  feelings when...
  • Na Tanu Samjhawan Ki Song lyrics
    Na Tanu Samjhawan Ki Song Lyrics With English Translation Movie : Humpty Sharma ki Dulhaniya Song : Samjhawan Song Singer : Arijit ...
  • Detail Introduction about C#.Net
    Brief Introduction about C#.Net  Introduction C#.Net is the one of the Programming Language the .Net Framework also contains ano...
  • Love Failure Quotes and Sad valentines day Quotes
    We Love Someone is a easy process sometime takes long time to love someone love others within short period but anyway always love dependin...
  • Top 10 valentine's day Quotes and Greetings wishes
    All Lovers have Anxiety in Valentines day because it is a festival to all lovers in these they enjoy a lot and celebrate the Valentine...
  • Wonderful sayings about Life.
    I Believe Follow  Things(Life Quotes) I Believe I believe: ********** Believe in Life ********** That we don't have to chan...
  • Brief Description about Multicast Delegate
    Multicast delegate is an extension of normal delegate. It helps you to point more than one method at a single moment of time. Multicast ...
  • Letter B wallpapers and keychains for facebook
    In these we are Providing Letter B Wallpapers and awesome Key chains also Some Facebook Profile Pictures and cover photos also we are prov...
  • Best Good Afternoon wishes greetings and quotes
    Top Most Good Afternoon Wishes Good Afternoon wishes are gives a relaxation in afternoon time.This wishing can be done between 12 to 3 p...

Categories

  • Entertainment (67)
  • TechnicalQuestions (58)
  • Quotes (11)
  • C#.Net (8)
  • Java (8)
  • ValentinesDay (4)
  • SEO (3)
  • Home
  • About Us
  • Disclaimer
  • Privacy Policy
  • Sitemap

Copyright © 2015-2017 Good Friends 5.All Rights Reserved• And Our Sitemap • All Logos and Trademark Belongs To Their Respective Owners•