Вы находитесь на странице: 1из 1

* not true abt def cnstr

3.any obj
* class Test1 int i=10; i=50; printNumber(int i)
50 10
* Demo int = new Demo(20)
20
* public class
* Exam1 int a=0; a++;
compile error
* a constructor A, B and C
* it is mandatory to speify return type with methd decl
* invisible outside class
private
* class AQuestion int i=j; int j=10;
compile error
* java.lang is default package fundamental classess
* MyClass int i; float j; "i="+i+"j="+j
compile error
* StatusDemo id++; id=id+status=status
id=0 status:D
* Test myName; lastName
private int myValue= 10;
compile error
**** variables inside method cannot be private
compile error
* class name can hv _ or $
* static means method can b called without instantiating class
** private is most retrictive access level
* public member of class are visible to any class in the java program, irrespect
ive of whether these classes are in the package or in another package.
*** default values for statis n instance var 0
** private var fr encapsulation n public getter methods
** public class diff pkg 1st import
**-

Вам также может понравиться