Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners Package Access Specifier
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Mohit Verma
Package Access Specifier
1 Answer(s)      5 years and 2 months ago
Posted in : Java Beginners



Advertisement
View Answers

November 13, 2009 at 1:04 PM


Hi Friend,

We have modified your code:

1)House.java
class Test{
static int a,b,c;
protected static void show(){
a=10;
b=20;
}
protected void add(){
c=a+b;
System.out.println("\n\n Addition is.."+c);
}
}
public class House extends Test{
protected static void sub(){
show();
c=a-b;
System.out.println("\n\n Subtraction is.."+c);
}
}

2 Blood.java
public class Blood extends House{
public static void main(String[]args){
sub();
}
}

Thanks


Related Tutorials/Questions & Answers:
Package Access Specifier - Java Beginners
Package Access Specifier  Hello Friends, I have created a Pkg named BCA , iN this Package i declare two classes name : - Test Class... as possible:- package BCA; class Test { int a,b,c; protected void
Access Specifier
Access Specifier  What's the usage of getter and setter in access specifier? Thank You
Advertisements
specifier
specifier  hello , im a beginner in java .... i want to ask how i can make a space and 2 decimal place at once.. i mean at one S.O.P .. example : System.out.printf("%.7s %.2f", amount); i want to use two specifier but when i run
specifier
specifier  hello , im a beginner in java .... i want to ask how i can make a space and 2 decimal place at once.. i mean at one S.O.P .. example : System.out.printf("%.7s %.2f", amount); i want to use two specifier but when i run
modifier and specifier
modifier and specifier  what is diff between Access modifier and specifier
specifier and identifier
specifier and identifier  what is the difference between specifier and identifier in java
package
games.use default and parameterised constructor. make use of protected access specifier and also use the finalize() method   We have created a package...package  write a package for games which have two classes indoor
package
can allow types in one package to have unrestricted access to one another, still restricting the access for the types outside the package
Package
Package  Create a Package named com.example.code. Write few classes, interface and abstract classes. Now create a class names PackageDemo that uses the classes of this package from other package
Package
Package  Create a Package named com.example.code. Write few classes, interface and abstract classes. Now create a class names PackageDemo that uses the classes of this package from other package
package:
package:  i hv created created a package and save it into D... in a package world. The we specify the keyword package with the name of the package. package world; public class HelloWorld { public static void main(String
package:
package:  i hv created created a package and save it into D... in a package world. The we specify the keyword package with the name of the package. package world; public class HelloWorld { public static void main(String
package
package  by what name we can save a java file that contain a package {i.e package p;} and several public classes {i.e public class abc} but not a main method
package
package  hello, What is a package?   hello, To group set of classes into a single unit is known as packaging. Packages provides wide namespace ability
package
package  Smith has created a package named ApplianceDetails that contains the Appliance class.Now he wants to create a class named NewAppliance that stores the details of the newly launched appliances.He uses the following syntax
package
package  Smith has created a package named ApplianceDetails that contains the Appliance class.Now he wants to create a class named NewAppliance that stores the details of the newly launched appliances.He uses the following syntax
access
access   This is Nitha Sriram i am having a problem that, i am having a combo box in the JSP page when i select an item from that i am calling the onchange function. In javascript i am getting the value now i want to pass
What is a package?
What is a package?  hi, What is a package? thanks   Hi, The Package is a mechanism for organizing the group of related files... programming language, A package is group of related types of classes & interfaces
Java package,Java Packages
will be saved in the package named mypackage. Access protection in packages No modifier... Java Package       Introduction to Java Package A Java package is a mechanism for organizing a group
problem with package
message as can not access package class methods...problem with package  Dear sir, i have created one java file with package com.net; and i compiled the program.it showing the .class file
Access Specifiers and Access Modifiers
Access Specifiers and Access Modifiers  What are Access Specifiers and Access Modifiers
package in java
package in java  when i run a package it give a error exception in thread "main" java.lang.NoClassDefFoundError what i do
package creation
package creation  program to create package having four different class in java
Package in Applet
Package in Applet  How do I use this technique for applets
Java package
Java package  Which package is always imported by default
Java package
Java package  What restrictions are placed on the location of a package statement within a source code file
Package in Servlet
Package in Servlet  How Create Package in Servlet ?   package packagename ; import java.io.*; import javax.servlet.*; import..."); PrintWriter out = response.getWriter(); out.println("Hello,Package Example
Java package
;For example, the Date class of java.util  package is used to access... Java package       Introduction to Java Package Package is a mechanism for organizing a group
Java.io package
Java.io package  List the names of various classes supported by Java.io package to handle character stream.   Reader and Writer classes and their subclasses
access specifiers and access modifiers
access specifiers and access modifiers  I want a powerpoint presentation for access specifiers and access modifiers. Please send me the same and soon
Using Protected Access in JSP
Using Protected Access in JSP          In java there are three types of access specifiers: public, protected, private. We always declare access specifiers
 

 

 

DMCA.com