Online Examination System for all learner!!! coming soon..

JAVA : Program to find sum of all integer greater than 100 and less than 200, that are divisible by 5

 Code:

class findsum
//for more program please visit www.programtubenotes.blogspot.in
{
    public static void main(String args[])
    {
        int a,sum=0;
        for(a=100;a<=200;a++)
        {
            if(a%5==0)
                sum=sum+a;
        }
        System.out.println("Sum="+sum);
    }
}

Output: 

Sum=3150

Java : Write a short note on Multilevel hierarchy.

In our previous tutorial we have discussed all about Inheritance. What is it? Why it is required? and its different types! Moreover, we have already come across Simple Inheritance, here we will discuss Multilevel Inheritance. It is nothing but the enhancement of the Simple Inheritance. From the type name it is pretty much clear that Inheritance is done at ‘n’ number of levels, where n>1.
In simple inheritance a subclass or derived class derives the properties from its parent class, but in multilevel inheritance a subclass is derived from a derived class. One class inherits only single class. Therefore, in multilevel inheritance, every time ladder increases by one. The lower most class will have the properties of all the super classes’.
So it will be like this:
  Person
      ↓
Employee
      ↓
Manager
N.B: Multilevel inheritance is not multiple inheritance where one class can inherit more than one class at a time. Java does not support multiple inheritance.
We will understand Multilevel Inheritance using the following example:
Code:
class Person{
  String personName;
  String address;
  Person(String personName,String address){
    this.personName = personName;
    this.address = address;
  }
  void showPersonalDetails(){
    System.out.println("Name is: "+personName);
  }
}

class Employee extends Person{
  String employeeID;
  double salary;
  Employee(String personName,String address,String employeeID,double salary){
    super(personName,address);
    this.employeeID = employeeID;
    this.salary = salary;
  }
}

class Manager extends Employee{
  int numberOfSubordinates;
    Manager(String personName,String address,String employeeID,double salary,int numberOfSubordinates){
    super(personName,address,employeeID,salary);
    this.numberOfSubordinates = numberOfSubordinates;
  }
}

class MultileveleInheritance{
  public static void main(String args[]){
    Person p =  new Person();
    Employee e = new Employee();
    Manager m = new Manager();
  }
}
Output:

Explanation of Code & Output

Here Person, Employee and Manager are three classes. Manager subclass is derived from Employee subclass which is again derived from Person class. All these classes has one to one relation. So Manager class is the most specialized class among the three which will have the access right to all the members of both Employee and Person. On the other hand, Person super class won’t have access to any of the members of its subclasses, same is true for Employee subclass which won’t have access to the any members of Manager subclass.
All these three classes are written in single java file for your understanding but generally these are put in three different java files.
Next we will checkout how to do method overloading in Java.

VB 6.0: Design a form contains a sorted list alphabetically.

Design a form contains a sorted list alphabetically such that the user can add the item from text to the list after click on command button "add".
Sol:
//for more program please visit www.programtubenotes.blogspot.in 
Private Sub Form_Load()
    List1.List=""

   List1.Sorted=True
   Text1.Text=""
    Command1.Vaption="add"
 End Sub
Private Sub Command1_Click()
list1.AddItem (Text1.Text)
Text1.Text = " "
End Sub


Output:-
after Run the get this window


What is Java technology and why do I need it?


Java is a programming language and computing platform first released by Sun Microsystems in 1995. There are lots of applications and websites that will not work unless you have Java installed, and more are created every day. Java is fast, secure, and reliable. From laptops to datacenters, game consoles to scientific supercomputers, cell phones to the Internet, Java is everywhere!

Is Java free to download?
Yes, Java is free to download. Get the latest version at java.com.
If you are building an embedded or consumer device and would like to include Java, please contact Oracle for more information on including Java in your device.

Why should I upgrade to the latest Java version?
The latest Java version contains important enhancements to improve performance, stability and security of the Java applications that run on your machine. Installing this free update will ensure that your Java applications continue to run safely and efficiently.
MORE TECHNICAL INFORMATION


What will I get when I download Java software?
The Java Runtime Environment (JRE) is what you get when you download Java software. The JRE consists of the Java Virtual Machine (JVM), Java platform core classes, and supporting Java platform libraries. The JRE is the runtime portion of Java software, which is all you need to run it in your Web browser.
What is Java Plug-in software?
The Java Plug-in software is a component of the Java Runtime Environment (JRE). The JRE allows applets written in the Java programming language to run inside various browsers. The Java Plug-in software is not a standalone program and cannot be installed separately.
I have heard the terms Java Virtual Machine and JVM. Is this Java software?
The Java Virtual Machine is only one aspect of Java software that is involved in web interaction. The Java Virtual Machine is built right into your Java software download, and helps run Java applications.
» Learn more about Java Technology



You might also be interested in:
  1. Explain various features of JAVA. How JAVA differs from C++?
  2. What is dynamic method dispatch ?
  3. What is Constructor ? What are its type ?
  4. What is Package ? How to define your own defined package ? Justify why CLASSPATH Environment variable needs to be set before you use it?
  5. Differentiate between constructor and destructor.
  6. Differentiate between method overloading and method overriding.
  7. What is method over riding. How it differs from method overloading. Write a Java program to discuss the above.
  8. What is the difference between break and continue? Write a Java program to discuss the difference between them.
  9. what is Thread ? Explain the life cycle of Thread. hat do you mean by daemon thread ? 
  10. Why JAVA doesn't support multiple inheritance ? How JAVA supports alternate approach to support the concept of multiple inheritance ?
  11. What is JVM? Justify the statement "Java is Plattform independent".
  12. What do you mean by interface in JAVA ? What are it's properties ? 
  13. Write short note on Garbage collection.
  14. Write a short note on Multilevel hierarchy.


 

JAVA : Program to demonstrate concept of Polymorphism (Overriden).

 demonstrate concept of Polymorphism (Overriden).

Sourse Code:

class Funcover

{

public void calc(int x,int y)

{

int z;

z=x*y;

System.out.println("multiplication="+z);

}

}

class Override extends Funcover

{

public void calc(int x,int y)

{

int z;

z=x/y;

System.out.print("division="+z);

}

}

class Overrideex

{

public static void main(String arg[])

{

Funcover f1=new Funcover();

f1.calc(7,6);

Override f2=new Override();

f2.calc(14,2);

}

}

Output:

multiplication=42

division=7 

C Programming Online Test 1

Following quiz provides Multiple Choice Questions (MCQs) related to C Programming Framework. You will have to read all the given answ...