Package Access Specifier

Package Access Specifier

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
ModuleNotFoundError: No module named 'dephell-specifier'
ModuleNotFoundError: No module named 'dephell-specifier'  Hi, My... named 'dephell-specifier' How to remove the ModuleNotFoundError: No module named 'dephell-specifier' error? Thanks   Hi, In your
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
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
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,ADS_TO_REPLACE_1 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 Specifiers and Access Modifiers
Access Specifiers and Access Modifiers  What are Access Specifiers and Access Modifiers
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
Java package,Java Packages
HelloWorld.java will be saved in the package named mypackage.ADS_TO_REPLACE_2 Access... Java Package       Introduction to Java Package A Java package is a mechanism for organizing a group
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
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
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
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
Java package
Java package       Introduction to Java Package Package is a mechanism for organizing a group... and category.  An example of package is the JDK package of SUN Java as shown
ms access
ms access  how to delete the autonumber from ms access using java delete code
Access Modifiers
Access Modifiers       Access Modifiers : Access modifiers are used to specify the visibility... some access modifiers like: public, private etc.. These can also be used
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
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
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
MS ACCESS
-> data sources. 2)Click Add button and select the driver Microsoft Access...; </body> </html> REGISTRATION.JAVA package validate... = DriverManager.getConnection("jdbc:odbc:Driver={Microsoft Access Driver (*.mdb, *.accdb
Ms Access
Ms Access   How to get query for Primary key from MsAccess?   SELECT column_name FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE WHERE table_name = 'data';   SELECT column_name FROM INFORMATION_SCHEMA.KEY_COLUMN
Access specifiers
Access specifiers  Why we are giving "public static void main"? How many times declared the main()?   Hi Friend, We used this statement as it provides the "entry point" for the program. Whenever the program executes
MS-Access
MS-Access  I am trying to upload a image to ms-acess using jsp,and my problem is that it shows some error int the browser that "java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver]COUNT field incorrect ".I think i set
access into radio button
access into radio button  access the four fields of database called access,access file and stored in radio button.please help
ms access
has to login . i already created ms access page and inserted values throught... and password" from my ms access............and detail in register(table in my ms access) need to display values in jsp .............please help me dis is my
ms access
has to login . i already created ms access page and inserted values throught... and password" from my ms access............and detail in register(table in my ms access) need to display values in jsp .............please help me dis is my
ms access
has to login . i already created ms access page and inserted values throught... and password" from my ms access............and detail in register(table in my ms access) need to display values in jsp .............please help me dis is my
ms access
has to login . i already created ms access page and inserted values throught... and password" from my ms access............and detail in register(table in my ms access) need to display values in jsp .............please help me dis is my
package creation
package creation  program to create package having four different class in java
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
What is the access scope of a protected method?
What is the access scope of a protected method?  Hi, What is the access scope of a protected method? thanks   Hi, In Java program, A protected method can be accessed by the classes within the package
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
insert code jsp to access
insert code jsp to access   insert code jsp to access
Random Access File.
Random Access File.  Explain Random Access File
access modifier - Java Interview Questions
access modifier  can someone explain to me all about java access modifier including the defualt modifier.  Hi Friend, Access Modifiers... or package. Private Modifier- The private members can only be accessed within

Ads