Basic Knowledge of Java

  1. History of Java
  2. What is Java technology and why do I need it? 
  3. Why is java popular for the Internet ?
  4. Features of Java.
  5. How Java program runs ?
Run Java Program in cmd.

1.   Compile Java File:
                    >javac filename.java

2.   Run :
                   >java filename

Simple Java Programs

1.   First Welcome Program.Show
2.   WAP to find area of circle ? Show
3.   WAP to check given number is odd or even ? Show
4.   WAP to find maximum and minimum number from gave three numbers ? Show
5.   The marks obtained by a student in 6 different subjects are input through the
      keyboard and calculate division as per the following rules:
      · Percentage above or equals to 70 - Distinction Class
      · Percentage between 60 to 69 – First Class
      · Percentage between 50 to 59 – Second Class
      · Percentage between 40 to 49 – Third Class
      · Percentage less than 40 – Fail      
      WAP to calculate the class obtained by the student. Show
6.   WAP to Calculate factorial of given number. Show
7.   WAP to print Fibonacci series. Show
8.   WAP to perform addition and multiplication of two matrices. Show
9.   Write a Java program to arrange the five different numbers in ascending order, Input
      using command line argument. Show
10. Write a Java Program to display the 10 (ten) city names using the command-line
      arguments.Show
11. WAP to create a class student having following data members :
      roll no, name, sub1, sub2, sub3. Display the roll no, name, marks, total marks of student.Show
12. Create class Point3D having three instance variables x,y,z
        a. A constructor which used for initializes that variable for particular object using
            this keyword.
        b. Using Constructor to initialize value of instance variables
        c. Parameterized constructor to take value of instance variable from users.Show
13. Create two class A and B. Class B inherits class A. use the instance variable of class A
      through object of class B.Show
14. WAP to create three class hierarchy as A->B->C, Each class declares a method named
      hello () with same type signature. Create object of class A using constructor of class C
      with use of that object call hello() to check which method is called. Show
15. Write above program having inside method of child class call method of super class
      using keyword super. Instantiate all class’s object and using it call appropriate method.Show
16. Create an abstract class Shape with method display (). Create two class Rectangle and
      Circle which extend this Shape class and use method display () of it.Show
17. Write a Java program to create the package ‘date’ to display the tomorrow’s date.Show
18. WAP that accepts two strings in integer format as in command line argument. The first
      number is divided by the second number and the result is displayed. There are catch
      blocks and to handle different types of exception. If division by zero is attempted,
      ArithmeticException occurs. Implement this program using try, catch and finally.Show
19. Define an Exception called “NoMatchException” that is thrown when a string is not
      equal to “India”. Write a Java Program that uses this exception.Show
20. Create your own thread by extending thread class and print 1 to 10 with sleep of 1
      second b/w printing each number.Show
21. Create your own thread by implementing thread class and print even and Odd number. Show

22. WAP to initialize two strings and compare it using equal() and ==.Show
23. Write a program which read two strings from keyboard and concatenate them and
      print it.Show
24. WAP to demonstrate use of string functions like length (), insert (), append (),reverse ()
      using string and string buffer class.Show
25. Write an applet program to draw simple shapes of an object.Show
26. Write a program to draw object in such a way that it looks like a 3D Object.Show
27. Write an applet program to display a simple image.Show
28. Write a program to initialise the Frame
      · Set the title as MyPanel
      · Set the visiblity as true
      · Set size from the coordinate axis as (300,300)
      · SetLocation(100,100).Show
29. Write a program to define a Frame.
      · Set 100 Buttons array into it.
      · Set the size of a frame as (400,400)
      · Set the visibility as true
      · Set a FlowLayout as Left
      · And add those hundred buttons into the frame.Show
30. Create a Frame having
      · Border layout
      · Set the visiblity as true
      · Set the size as (400,400)
      · Also put the TextArea into it
      · Along with the area put Button named “Header”,”Footer”,”Right”,”Left”.
      · Set the button as the following “Header” button on north side, “Footer” Buttton
        on “South” side, “Right” button on East side, and “Left” button on West side.
     · And in the centre set the text area defined above.Show


0 comments:

Post a Comment

Digital Marketing

Subscribe to RSS Feed Follow me on Twitter!