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



Home Answers Viewqa Java-Beginners Package Access Specifier

Have Programming Question? Ask it here!
 
 
 


Mohit Verma
Package Access Specifier
1 Answer(s)      4 years and 9 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
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
userdefined package
userdefined package  package javap; class HelloWorld { public... declare a package then in command prompt i set the classpath.After that i compiled the class and run the package then i got the error C:\Users
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
use of package concepts
use of package concepts  i m getting error when i use .* method to access all package files. when i use this through another method like packagename.classname, it works but in this method i will have to write all class names. i
Java Package
Java Package       In a computer terminology, package is a collection of the related files in the same directory. Package avoids naming conflicts between the files and make possible
Package categories in Java
Package categories in Java     ... hierarchy structure shown above. Note that, the package "java" also has subpackages in which the package "awt" is further has a subpackage called
Package Versioning - java tutorials
Package Versioning 2001-07-25 The Java Specialists' Newsletter [Issue 026] - Package Versioning Author: Herman Lintvelt If you are reading... first newsletter... Package Versioning While having a (rare) bit of idle
add new package java
add new package java  How to add new package in Java
Access level
Access level  Which access level allows exclusive access to the attributes and methods that belong to a class or classes derived from that class? default protected public private
How to Access MS Access in jar.
How to Access MS Access in jar.  how do i access my Ms-Access file... to access it via Code or is their any alter-native?? Do i need any Driver to do this ... i m able to access a Ms-access via JDBC but cant find the file wen
The package keyword
The package keyword       The package in java programming language is a keyword that is used to define a package that includes the java classes. Keywords are basically reserved words
What is a Java package and how is it used?
What is a Java package and how is it used?   HI, What is a Java package and how is it used? thanks,   Hi, In Java, package is a group of associated types of classes and interfaces that offers access protection
ms access
ms access  how to delete the autonumber from ms access using java delete code
MS access
MS access  how do i access my Ms-Access file placed in the same jar file where my application code/class file r present??? Want to access it via Code. Can anyone help me ? Please give reply urgent...   give me reply
connectivity with access
connectivity with access  how to connect with data base with access...; Is this Access database or excel sheet. Do you want to display the values...;Is this Access database or excel sheet. Do you want to display the values in Textarea
package - Java Beginners
Creating a package in Java  Create a package called My Package. In this, create a class call Marks that specifies the name of student, the marks in three subjects and the total of these marks. Displays the details of three
Input and Output package
to know the header file which gives me the access to this read and writeln statements...(); } } For more information, visit the following link: Java IO package
package javax.ws.rs does not exist
package javax.ws.rs does not exist  Hi, Which jar file should I add to remove "package javax.ws.rs does not exist" error? Thanks
Which package is imported by default?
Which package is imported by default?  hi, Which package... package is imported by default? The java.lang package is imported by default even without a package declaration. In Java class has been imported in the following
import package - JSP-Servlet
import package  how to import a package into a jsp page...pls reply with an example..  Hi friend, To import a package in Jsp use the import Attribute of page Directive In JSP The package name folder is putted
Joomla Starter Package
Joomla Starter Package This is a basic package in which we offer all the necessary features that needs a basic package. This package can be managed... effortlessly whenever they want. This is an ideal package in small budget. We
MS ACCESS
-> data sources. 2)Click Add button and select the driver Microsoft Access...;/div> </body> </html> REGISTRATION.JAVA package validate... = DriverManager.getConnection("jdbc:odbc:Driver={Microsoft Access Driver (*.mdb
MS ACCESS
-> data sources. 2)Click Add button and select the driver Microsoft Access...;/div> </body> </html> REGISTRATION.JAVA package validate... = DriverManager.getConnection("jdbc:odbc:Driver={Microsoft Access Driver (*.mdb
 

 

 

DMCA.com