Skip to content

Commit a6e2ea1

Browse files
Add files via upload
1 parent 28b9ecb commit a6e2ea1

File tree

71 files changed

+831
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+831
-0
lines changed

Access__modifiers/bin/Emp.class

854 Bytes
Binary file not shown.
679 Bytes
Binary file not shown.
+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
class Emp
2+
{
3+
int eid;
4+
int salary;
5+
String ceo;
6+
7+
//this is method
8+
public void show()
9+
{
10+
System.out.println(eid +" : "+salary +" : " + ceo);
11+
}
12+
13+
}
14+
15+
public class Static_demo {
16+
17+
public static void main(String[] args)
18+
{
19+
Emp prasad=new Emp();
20+
prasad.eid=45;
21+
prasad.salary=40_000;//this means that fourty thousand
22+
prasad.ceo="BillGates";
23+
24+
25+
Emp praveen=new Emp();
26+
praveen.eid=40;
27+
praveen.salary=40000;
28+
praveen.ceo="BillGates";
29+
30+
//now i want to update the ceo of praveen
31+
praveen.ceo="MarkZukenberg";
32+
33+
prasad.show();
34+
praveen.show();
35+
36+
37+
38+
}
39+
40+
41+
}
42+
43+
/*
44+
NOTE:To access static variables we don't need object.
45+
46+
47+
48+
____________________________>>>>>>>>>>>>>>>>>>>PrasadBylapudi<<<<<<<<<<<<<<<<<<<<<<_______________________________________________
49+
50+
*/
51+
52+
53+
285 Bytes
Binary file not shown.

JavaBasics/bin/firstprogram.class

535 Bytes
Binary file not shown.

JavaBasics/bin/functionExample.class

726 Bytes
Binary file not shown.
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
public class Relational_operators
3+
{
4+
5+
}
6+
7+

JavaBasics/src/firstprogram.java

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
public class firstprogram
3+
{
4+
public static void main(String args[])
5+
{
6+
System.out.println("hello world");
7+
}
8+
}
9+
10+
*/
11+
public class firstprogram
12+
{
13+
public static void main(String args[])
14+
{
15+
int a=5;// we need to know about the declaration rules.wecan use $(dollar)symbol.
16+
a=9; // in java you can change values.
17+
System.out.println(a);
18+
//float f=10f;//for float u have to use the f at the end to know it is float.
19+
//double d=5.5
20+
21+
}
22+
}

JavaBasics/src/functionExample.java

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
2+
public class functionExample
3+
{
4+
5+
String name;
6+
String gender;
7+
int age;
8+
String color;
9+
String hair_color;
10+
11+
public functionExample(String name,String gender,int age,String color,String hair_color)
12+
{
13+
this.name= name;
14+
this.gender=gender;
15+
this.age=age;
16+
this.color=color;
17+
this.hair_color=hair_color;
18+
19+
}
20+
21+
22+
public static void main(String[] args) {
23+
24+
}
25+
26+
}
643 Bytes
Binary file not shown.

OOPS_concept/bin/Calc.class

408 Bytes
Binary file not shown.

OOPS_concept/bin/Calc1.class

702 Bytes
Binary file not shown.
615 Bytes
Binary file not shown.
409 Bytes
Binary file not shown.

OOPS_concept/bin/ObjectDemo.class

657 Bytes
Binary file not shown.

OOPS_concept/bin/Parse_Int.class

517 Bytes
Binary file not shown.

OOPS_concept/bin/Sudent_class.class

1.01 KB
Binary file not shown.

OOPS_concept/bin/student.class

390 Bytes
Binary file not shown.

OOPS_concept/bin/this_keyword.class

379 Bytes
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
public class Arguments_using_prompt {
3+
4+
public static void main(String[] args) {
5+
6+
int n=args.length;
7+
for(int i=0;i<n;i++)
8+
{
9+
System.out.println(args[n]);
10+
}
11+
12+
}
13+
14+
}

OOPS_concept/src/ConstructorDemo.java

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
class Calc1 //note for editor.that is we don't create two classes with the same name in same project.
2+
{
3+
int num1;
4+
int num2;
5+
int result;
6+
7+
//this is constructor which doesn't take anything as the parameter
8+
public void Calc1()
9+
{
10+
num1=5;
11+
num2=5;
12+
System.out.println("IN constructor");
13+
14+
}
15+
16+
//another constructor with parameters only integers are taking
17+
public Calc1(int n)
18+
{
19+
num1=n;
20+
num2=n;
21+
22+
}
23+
24+
//here is constructor with parameters which is taking double only.
25+
public Calc1(double d)
26+
{
27+
num1=(int) d;//we need to typecast cuz of we declare num1 as integer
28+
//num2 =d;
29+
}
30+
31+
}
32+
public class ConstructorDemo {
33+
34+
35+
36+
public static void main(String[] args)
37+
{
38+
Calc1 obj=new Calc1(9.5); //constructor
39+
//Calc1 obj=new Calc1(7);
40+
//Calc1 obj=new Calc1(9.5);
41+
System.out.println(obj.num1);
42+
43+
44+
}
45+
46+
}
47+
/*
48+
NOTE ON CONSTRUCTOR:
49+
1.It is a member method
50+
2.Same as Class name
51+
3.It will never return anything.
52+
4.It is used to allocate memory.
53+
5.The defalut values of variables in java is zero wherre as in c lang we have garbage values.
54+
6.we can have two different constructors in same classs.
55+
they are like with parameters(arguments) and without(arguments) or privide them different parameters
56+
7.we can pass values from constrctors
57+
8.we don't need to call the constructor it will call automatically when object is created.
58+
59+
_____________________________>>>>>>>>>>>>>>>>>>>PrasadBylapudi<<<<<<<<<<<<<<<<<<<<<<_______________________________________________
60+
61+
*/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
public class Method_overloadingDemo {
3+
4+
public static void main(String[] args)
5+
{
6+
7+
8+
9+
}
10+
11+
}

OOPS_concept/src/ObjectDemo.java

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
//this is class
2+
class Calc
3+
{
4+
int num1;
5+
int num2;
6+
int result;
7+
//NOTE:defaulty every class have the constructor.which has the same name as the class name.
8+
9+
//this is method
10+
public void perform()
11+
{
12+
result=num1+num2;
13+
}
14+
}
15+
16+
17+
public class ObjectDemo {
18+
19+
public static void main(String args[])
20+
{
21+
//Calc obj;//this is reference to and class
22+
//object knows something and object does something.
23+
//obj=new Calc();
24+
Calc obj=new Calc();//instead of the above we can directly declare this.
25+
//this is constructor it allocates memory to the object.
26+
//the use of the constructor is to allocate memory to the object.
27+
obj.num1=3;
28+
obj.num2=7;
29+
30+
obj.perform();
31+
System.out.println(obj.result);
32+
}
33+
34+
}
35+
/*
36+
NOTE ON CONSTRUCTOR:
37+
1.It is a member method
38+
2.Same as Class name
39+
3.It will never return anything.
40+
4.It is used to allocate memory.
41+
5.The defalut values of variables in java is zero wherre as in c lang we have garbage values.
42+
6.we can have two different constructors in same classs.
43+
they are like with parameters(arguments) and without(arguments) or privide them different parameters
44+
7.we can pass values from constrctors unlike i declared for the above Calc class
45+
8.we don't need to call the constructor it will call automatically when object is created.
46+
47+
48+
_____________________________>>>>>>>>>>>>>>>>>>>PrasadBylapudi<<<<<<<<<<<<<<<<<<<<<<_______________________________________________
49+
50+
*/

OOPS_concept/src/Parse_Int.java

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
public class Parse_Int {
3+
4+
public static void main(String[] args)
5+
{
6+
int a=Integer.parseInt(args[0]);
7+
int b=Integer.parseInt(args[1]);
8+
int c=Integer.parseInt(args[2]);
9+
10+
11+
}
12+
13+
}

OOPS_concept/src/Sudent_class.java

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
2+
class student
3+
{
4+
int age;
5+
int Roll_no;
6+
String name;
7+
8+
//method
9+
public void display()
10+
{
11+
12+
}
13+
}
14+
15+
public class Sudent_class {
16+
17+
public static void main(String[] args)
18+
{
19+
20+
student obj1=new student();//object reference
21+
obj1.age=19;
22+
obj1.Roll_no=45;
23+
obj1.name="prasad";
24+
obj1.display();
25+
26+
System.out.println("age is "+obj1.age);
27+
System.out.println("roll no is " +obj1.Roll_no);
28+
System.out.println("name is "+obj1.name);
29+
30+
31+
32+
33+
34+
35+
}
36+
37+
}

OOPS_concept/src/this_keyword.java

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
public class this_keyword {
3+
4+
public static void main(String[] args) {
5+
6+
}
7+
8+
}

OPERATORS_demo/bin/Right_shift.class

730 Bytes
Binary file not shown.

OPERATORS_demo/bin/left_shift.class

726 Bytes
Binary file not shown.

OPERATORS_demo/src/Right_shift.java

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
public class Right_shift {
3+
4+
public static void main(String[] args) {
5+
int a=10;
6+
a=a>>1;
7+
System.out.println("right shift value of a is"+ a);
8+
9+
}
10+
11+
}
12+
/*
13+
NOTE: ON LEFT_SHIFT
14+
left shift means it will decreases the value;
15+
it means subraction or division;
16+
@) we have a formula for that that is a/2^n
17+
here a is the given number
18+
n is the no of bits to be shifted
19+
20+
21+
22+
23+
_____________________________>>>>>>>>>>>>>>>>>>>PrasadBylapudi<<<<<<<<<<<<<<<<<<<<<<_______________________________________________
24+
*/
25+

OPERATORS_demo/src/left_shift.java

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
public class left_shift {
3+
4+
public static void main(String[] args)
5+
{
6+
7+
int a=10;
8+
a=a<<1;
9+
System.out.println("left shift value of a is"+ a);
10+
11+
}
12+
13+
}
14+
15+
/*
16+
NOTE: ON LEFT_SHIFT
17+
left shift means it will increase the value;
18+
it means addition or multiplication;
19+
.it is ok with the smaller values what about for bigger values so, we have a formula for that
20+
.a* 2^n---------->this is for finding the left shift.
21+
a----> a is the given number.
22+
n---->n is the no of bits to be shifted.
23+
24+
25+
*/
26+
/*
27+
28+
_____________________________>>>>>>>>>>>>>>>>>>>PrasadBylapudi<<<<<<<<<<<<<<<<<<<<<<_______________________________________________
29+
30+
*/

Patterns/bin/Pattern1.class

647 Bytes
Binary file not shown.

Patterns/src/Pattern1.java

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
public class Pattern1 {
3+
public static void main(String[] args)
4+
{
5+
for(int i=1;i<=5;i++)
6+
{
7+
for(int j=1;j<=5;j++)
8+
{
9+
System.out.println("*");
10+
}
11+
System.out.println();
12+
}
13+
14+
}
15+
16+
}
631 Bytes
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)