Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
f454e81
Committed on or around 2023/08/18
ResilientSpring Aug 18, 2023
2c3955b
Committed on or around 2023/08/18
ResilientSpring Aug 18, 2023
6e1fac3
Committed on or around 2023/08/18
ResilientSpring Aug 18, 2023
2481955
Committed on or around 2023/08/18
ResilientSpring Aug 18, 2023
205a2eb
Committed on or around 2023/08/18
ResilientSpring Aug 18, 2023
a4e4824
Committed on or around 2023/08/18
ResilientSpring Aug 18, 2023
9916366
Committed on or around 2023/08/18
ResilientSpring Aug 18, 2023
1b3e9b3
Committed on or around 2023/08/18
ResilientSpring Aug 18, 2023
7e69611
Merge pull request #183 from ResilientSpring/SP7
ResilientSpring Aug 18, 2023
d1b4fc2
Committed on or around 2023/08/19
ResilientSpring Aug 18, 2023
5a1a8ba
Committed on or around 2023/08/19
ResilientSpring Aug 18, 2023
ac3dea3
Committed on or around 2023/08/19
ResilientSpring Aug 18, 2023
acb6d70
Committed on or around 2023/08/19
ResilientSpring Aug 18, 2023
fb5c82b
Committed on or around 2023/08/19
ResilientSpring Aug 18, 2023
a462713
Committed on or around 2023/08/19
ResilientSpring Aug 18, 2023
df51707
Committed on or around 2023/08/18
ResilientSpring Aug 18, 2023
f8bcdc0
Committed on or around 2023/08/19
ResilientSpring Aug 18, 2023
de9e03c
Committed on or around 2023/08/19
ResilientSpring Aug 18, 2023
61c0fcd
Committed on or around 2023/08/19
ResilientSpring Aug 18, 2023
cece961
Committed on or around 2023/08/19
ResilientSpring Aug 18, 2023
d351e74
Merge pull request #184 from ResilientSpring/SP7
ResilientSpring Aug 18, 2023
fd3748e
Committed on or around 2023/08/19
ResilientSpring Aug 19, 2023
858702e
Committed on or around 2023/08/19
ResilientSpring Aug 19, 2023
326698a
Committed on or around 2023/08/19
ResilientSpring Aug 19, 2023
3e7b0f1
Committed on or around 2023/08/20
ResilientSpring Aug 19, 2023
db06489
Committed on or around 2023/08/20
ResilientSpring Aug 19, 2023
a9fe9d6
Committed on or around 2023/08/20
ResilientSpring Aug 19, 2023
76c001e
Committed on or around 08/20
ResilientSpring Aug 19, 2023
a4ebc96
Merge pull request #185 from ResilientSpring/SP7
ResilientSpring Aug 19, 2023
2248082
Committed on or around 2023/08/20
ResilientSpring Aug 19, 2023
e4963cc
Committed on or around 2023/08/10
ResilientSpring Aug 20, 2023
2cc9e8c
Committed on or around 2023/08/27
ResilientSpring Aug 27, 2023
f5a1a01
Committed on or around 2023/08/27
ResilientSpring Aug 27, 2023
c982f3d
Committed on or around 2023/08/27
ResilientSpring Aug 27, 2023
100d8d3
Merge pull request #186 from ResilientSpring/SP7
ResilientSpring Aug 27, 2023
4394f4c
Merge pull request #187 from ResilientSpring/Laptop
ResilientSpring Sep 23, 2023
e8028e0
Merge pull request #188 from ResilientSpring/Laptop
ResilientSpring Sep 23, 2023
f0fca0d
Merge pull request #189 from ResilientSpring/Laptop
ResilientSpring Sep 25, 2023
c216b38
Merge pull request #190 from ResilientSpring/Laptop
ResilientSpring Sep 25, 2023
dc7c9b7
Merge pull request #191 from ResilientSpring/master
ResilientSpring Sep 30, 2023
c7f19ce
Merge pull request #192 from ResilientSpring/SP7
ResilientSpring Sep 30, 2023
0ac71d1
Merge pull request #193 from ResilientSpring/Laptop
ResilientSpring Sep 30, 2023
909e674
Merge pull request #194 from ResilientSpring/master
ResilientSpring Sep 30, 2023
87c9c11
Merge pull request #195 from ResilientSpring/SP7
ResilientSpring Sep 30, 2023
ed651ba
Committed on or around 2023/09/30
ResilientSpring Sep 30, 2023
c74fff2
Committed on or around 2023/09/30
ResilientSpring Sep 30, 2023
b40b402
Committed on or around 2023/09/30
ResilientSpring Sep 30, 2023
e207da4
Committed on or around 2023/09/30
ResilientSpring Sep 30, 2023
a2bf708
Merge pull request #196 from ResilientSpring/SP7
ResilientSpring Sep 30, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
package theoretical;

class TwoDShape_3{

private double width;
private double height;
String title;

public TwoDShape_3(double w, double h) {
width = w;
height = h;
}

public TwoDShape_3() {
// TODO Auto-generated constructor stub
}

TwoDShape_3(double width, double height, String title){

this.width = width;
this.height = height;
this.title = title;

}


// Construct object from an object.
TwoDShape_3(TwoDShape_3 ob){
width = ob.width;
height = ob.height;
}


double getWidth() {
return width;
}

double getHeight() {
return height;
}

void setWidth(double w) {
width = w;
}

void setHeight(double h) {
height = h;
}

void showDim() {

System.out.println("Width and height are " + width + " and " + height);
}

String showTitle() {
return title;
}

void showTitle_2() {
System.out.println("Triangle is also " + title);
}

}


class Triangle_3 extends TwoDShape_3{

private String style;

public Triangle_3() {
// TODO Auto-generated constructor stub
}

public Triangle_3(String s, double w, double h) {
super(w, h);

style = s;
}

Triangle_3(String style, String title, double width, double height){

super(width, height, title);

this.style = style;

}

Triangle_3(Triangle_3 ob){
super(ob); // Pass a Triangle reference to TwoDShape's constructor.

style = ob.style;
}


double area() {
return getWidth() * getHeight() / 2;
}

void showStyle() {
System.out.println("Triangle is " + style);
}

String showTheTitle() {

return showTitle();

}

void showTheTitle_2() {
System.out.println("Triangle is also " + super.title); // super is redundant here.
}

void showTheTitle_3() {
System.out.println("Triangle is also " + title);
}

}


public class Super_Class_References_and_Subclass_Objects_2 {

public static void main(String[] args) {
// TODO Auto-generated method stub

Triangle_3 t1 = new Triangle_3("Outlined", 8.0, 12.0);

// make a copy of t1
Triangle_3 t2 = new Triangle_3(t1);


System.out.println("Info for t1: ");
t1.showStyle();
t1.showDim();
System.out.println("Area is " + t1.area());

System.out.println();

System.out.println("Info for t2: ");
t2.showStyle();
t2.showDim();
System.out.println("Area is " + t2.area());

}

}
23 changes: 23 additions & 0 deletions 23 Miscellaneous/Cpp/Arrays_of_strings.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package Cpp;

public class Arrays_of_strings {

public static void main(String[] args) {
// TODO Auto-generated method stub

String numbers[][] = {

{"Tom", "555-3322"},
{"Mary", "555-8976"},
{"Jon", "555-1037"},
{"Rachel", "555-1400"},
{"Sherry", "555-8873"}
};

System.out.println("numbers[0]: " + numbers[0]);

System.out.println("numbers[0][1]: " + numbers[0][1]);

}

}
56 changes: 56 additions & 0 deletions 56 Miscellaneous/Cpp/Assigning_Objects.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package Cpp;

class Test{

int a, b;

void set_ab(int a, int b) {

this.a = a;
this.b = b;

}

void show_ab() {

System.out.println("a is " + a + "\n");
System.out.println("b is " + b + "\n");
}
}

public class Assigning_Objects {

public static void main(String[] args) {
// TODO Auto-generated method stub

Test ob1 = new Test();
Test ob2 = new Test();


ob1.set_ab(10, 20);
ob2.set_ab(0, 0);

System.out.println("ob1 before assignment: ");
ob1.show_ab();
System.out.println("ob2 before assignment: ");
ob2.show_ab();
System.out.println();
ob2 = ob1; // assign ob1 to ob2

System.out.println("ob1 after assignment: ");
ob1.show_ab();
System.out.println("ob2 after assignment: ");
ob2.show_ab();

System.out.println();

ob1.set_ab(-1, -1); // change ob1

System.out.println("ob1 after changing ob1: ");
ob1.show_ab();
System.out.println("ob2 after changing ob1: ");
ob2.show_ab();

}

}
54 changes: 54 additions & 0 deletions 54 Miscellaneous/Cpp/Passing_Objects_to_Functions.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package Cpp;

class My_Class {

int value;

public My_Class(int value) {
// TODO Auto-generated constructor stub

this.value = value;
}

int get_value() {
return value;
}

void set_value(int value) {
this.value = value;
}

static void display(My_Class ob) {

System.out.println(ob.value);

}

static void change(My_Class ob) {
ob.set_value(100);
System.out.println("Value of ob inside: ");

display(ob);
}
}

public class Passing_Objects_to_Functions {

public static void main(String[] args) {
// TODO Auto-generated method stub

My_Class a = new My_Class(10);

System.out.println("Value of a before calling change(): ");

My_Class.display(a);

My_Class.change(a);

System.out.println("Value of a after calling change(): ");

My_Class.display(a);

}

}
36 changes: 36 additions & 0 deletions 36 Miscellaneous/Cpp/Reference_Variables_and_Assignment.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package Cpp;

class Car{

int passengers;
int fuelcap;
int mpg;

}

public class Reference_Variables_and_Assignment {

public static void main(String[] args) {
// TODO Auto-generated method stub

Car vehicle1 = new Car();
Car vehicle2 = vehicle1;

vehicle1.mpg = 26;

System.out.println(vehicle1.mpg);
System.out.println(vehicle2.mpg);

//////////////////////////////////////

Car vehicle3 = new Car();

vehicle2 = vehicle3;

System.out.println(vehicle1.mpg);
System.out.println(vehicle2.mpg);
System.out.println(vehicle3.mpg);

}

}
29 changes: 29 additions & 0 deletions 29 Miscellaneous/Cpp/Reference_Variables_and_Assignment_2.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package Cpp;

class Car2{

int passengers;
int fuelcap;
int mpg;

}

public class Reference_Variables_and_Assignment_2 {

public static void main(String[] args) {
// TODO Auto-generated method stub
Car2 vehicle1 = new Car2();
Car2 vehicle2;

vehicle2 = vehicle1;

vehicle1.mpg = 26;

System.out.println(vehicle1.mpg);
System.out.println(vehicle2.mpg);

System.out.println();

}

}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.