bhatti mansha

Greenhorn
+ Follow
since Jan 03, 2003
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by bhatti mansha

i need further explanation
can any body explain me abt high order bit and low order bit.
what is the participation of high order bit inthis program.
faheem
hi!
i m faheem and preparing java1.4exam
i m very confuse abt this code plz help me how can it complile and what happan behind it;
class A3{
public static void main(String args[]){
int a,b;
a=10;
System.out.println("The value of a is "+a);
char c='32';
System.out.println("The value of character is "+c);
byte tiny=(byte)775; (<------------)
System.out.println("The value of tiny is " +tiny);
}
}
look at this line
byte tiny=(byte)775; (<------------)
System.out.println("The value of tiny is " +tiny);
what happan this
i know abt byte its width is 255;
but we r cast it in "775"
and it is complie and give answer is 7 on this line
and abt one more if we cast it in it 255 it give them a answer 1
and if i put it in 256 it give 0
i m also confuse abt it
is it's width is 256 not 255
and i think it is count 0 also with counting 0 it is not possilbe plz help me
am i right or not
hi!
i m faheem and preparing java1.4exam
i m very confuse abt this code plz help me how can it complile and what happan behind it;
class A3{
public static void main(String args[]){
int a,b;
a=10;
System.out.println("The value of a is "+a);
char c='32';
System.out.println("The value of character is "+c);
byte tiny=(byte)775; (<------------)
System.out.println("The value of tiny is " +tiny);
}
}
look at this line
byte tiny=(byte)775; (<------------)
System.out.println("The value of tiny is " +tiny);
what happan this
i know abt byte its width is 255;
but we r cast it in "775"
and it is complie and give answer is 7 on this line
and abt one more if we cast it in it 255 it give them a answer 1
and if i put it in 256 it give 0
i m also confuse abt it
is it's width is 256 not 255
and i think it is count 0 also with counting 0 it is not possilbe plz help me
am i right or not
is exception is not a run time error
or it is cheaked by JVM
i hope it is right
kay if exception is create or a object i create
and object go to Exception class and find his sub classes
but you al of r talking abt compiler
is complier also cheak exception
plz help me in it. I m student
Faheem
no , java can not aloud to make multiple superclasses
but a superclass have a lot of sub classes
means eg
class a{
}
class b extends a{
}
class c extends a{
}
in it "a" is a super class and "b" is sub class who extend him but "c" also extends "a" so "a" is also superclass of "C".
it is possible;
but a subclass can not create a multiple
superclasses
eg
class a{
}
class b extends a{
}
class c extends a,b {// error
}
but interface u can extends more then 2 interface
e.g
interface a {
}
interface b{
}
class C implement a,b{
}
it is possible
ok i hope u r clear more
if i can write some wrong plz clear me
thanx
Faheem
21 years ago
class C{
private int p;
static void fun1() {
C a = new C();
a.p = 2; // p is definitely accessible here -- // private means it can be accessed within the same class.
} // so we'll create a setter method so that we can let other classes set the value of p public setP( int newValue ) {
p = newValue;
}
}
public class D{
public static void main (String[] args) {
C c= new C();
c.p = 4; // not allowed class D doesn't have access to p, its private!
c.setP( 8 ); // the method setP() is public -- so you use that to set the value of P
}
}
u call p from its class object
C c= new C();
c.p = 4; //
"C" is object of c class
and calling c.p;
is private is not accessible throw his class object
if it is out of class
thanx
Faheem
hi like_java
there is another reason
byte have capacity to store 225 and u put in 100
so complier have no problem to complie this code easyly
if there u pass 256 then this is error
and for this u can use costing
thanx
MANSHA BHATTI
i hope you will clear more